ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Select output for the following set of code?

  1. class sample
  2. {
  3. public int i;
  4. public int[] arr = new int[];
  5. public void fun(int i, int val)
  6. {
  7. arr[i] = val;
  8. }
  9. }
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. sample s = new sample();
  15. s.i = ;
  16. sample.fun(1, 5);
  17. s.fun(1, 5);
  18. Console.ReadLine();
  19. }
  20. }

user-image
تم إضافة السؤال من قبل Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
تاريخ النشر: 2016/10/21
raman panwar
من قبل raman panwar , Software Developer , Wipro Technology

Compile time errors will come.

line 4 - size of an array is not mentioned

line 15 - no value 

line 16 - fun method is not static , so cannot use class name for calling fun method

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟