What will be the output of the following Java program?

class variable scope

{

public static void main(String args[ ])

{

int x;

x = 5;

{

int y = 6;

System. out. print(x +" "+ y);

}

System. out. println(x +" "+ y);

}

}

1
5656
2
565
3
Runtime error
4
Compilation error
5
Question Not Attempted

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation