Welcome Guest | Sign in | Register
Flow Control - Discussion Page For Q.2768 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Flow Control > Questions and Answers

Q: class F
{
Static public void main(String args[])
{
System.out.println(“HI”);
}
}
A. compile time error B. run time error
C. HI D. no output

Answer and Explanation

Answer:HI

Explanation:
Here we have swaped static keyword and public access specifier, that doesn’t effect the execution but if you swap void and main it will throw an error. Normal execution , JVM will execute from main method and displays HI.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.