Submitted by heartin on Sun, 08/23/2015 - 11:57
Given:
public class HelloWorld{
public static void main (String[] args)
{
System.out.println("Hello World!");
}
}
Select 1 option below, if the above class is declared in a file Hello.java:
A. Compilation will fail
B. Compilation succeeds, but execution fails with an exception
C. Compilation and execution succeeds and it prints 'Hello World!'
D. Compilation and execution succeeds and it prints nothing.
Submitted by heartin on Sun, 08/23/2015 - 11:50
Given:
class HelloWorld{
public static void main (String[] args)
{
System.out.println("Hello World!");
}
}
Select 1 option below, if the above class is declared in a file Hello.java:
A. Compilation will fail
B. Compilation succeeds, but execution fails with an exception
C. Compilation and execution succeeds and it prints 'Hello World!'
D. Compilation and execution succeeds and it prints nothing.