What will be the output of the program (when you run with the -ea option)
public class Test
{
public static void main(String[] args)
{
int x = 0;
assert (x > 0) : "assertion failed"; /* Line 6 */
System.
out.
println("finished");
}
}

Finished
 
Compilation fails.
 
An AssertionError is thrown.
 
An AssertionError is thrown and finished is output.
 

Answer

A Foxoyo User

Statistics

0 Level
0
Attempts
0
Accuracy
0
Bookmark
0
Tags

Quizes

Related Questions