Multiple choice technology programming languages

public class Question { public static void main(String args[]) { int x=y=10; y=12; System.out.print(x+"&"+y); } }

  1. 10 & 12

  2. 10 & 10

  3. Compile Time Error

  4. None

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The statement int x=y=10; attempts to use variable y before declaration. In Java, all variables must be declared before use, making this a compilation error. The chained assignment syntax requires all variables to be pre-declared or declared together.