MCQ Single Best Answer Not Set

QDetermine output:
public class Test{
        public static void main(String[] args){
                int[] x = {1, 2, 3, 4};
                int[] y = x;

                x = new int[2];

                for(int i = 0; i < x.length; i++)
                        System.out.print(y[i] + " ");
        }
}

ID: #2202 Array in Java 1,926 views
Question Info
#2202Q ID
Not SetDifficulty
Array in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 1 2 3 4
  • B 0 0 0 0
  • C 1 2
  • D 0 0
Correct Answer: Option C

Explanation

1 2

Share This Question

Challenge a friend or share with your study group.