What will be the output when the following class is compiled and run?
public class Main{ static int x = 5; public static void main (String [] args){ int x = ( x=3 ) * 4; // 1 System .out.println (x); } }
Select 1 option
Correct Option is : D
x is first initialized by x = 3, then the value of this expression (i.e. "x = 3"), which is 3, is multiplied by 4 and is again assigned to x. So it prints 12.