Question: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];
 }
}
 

A 0 

B 1 

C An exception will occur 

D 4 

+ Answer
+ Report
Total Preview: 718

Copyright © 2024. Powered by Intellect Software Ltd