Computer Science, asked by dd0166900, 10 days ago

What is the output of following Java Program?

class Test {

int x = 10;

public static void main(String[] args) {

System.out.println(x);

}

}


Select one:

10
Runtime Exception
0
Compile Time Error

Answers

Answered by siddhipalkar10
3

Answer:

Compiler Error

Explanation:

Main.java:4: error: incompatible types

throw 10;

^

required: Throwable

found: int

Main.java:6: error: unexpected type

catch(int e) {

^

required: class

found: int

2 errors

Similar questions