MCQs > IT & Programming > Java > Output of this program? public class Test { public static void main (String args[]) { int a, b; a = 2; b = 0; System.out.println (g (a, new int[] {b})); } public static int g (int a, int b[]) { b[0] = 2 * a; return b[0]; } }

Java MCQs

What will be the output of this program?

 public class Test
 {
 public static void main (String args[])
 {
 int a, b;
 a = 2;
 b = 0;
 System.out.println (g (a, new int[] {b}));
 }
 public static int g (int a, int b[])
 {
 b[0] = 2 * a;
 return b[0];
 }
 }

Answer

Correct Answer: 4

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it