Welcome Guest | Sign in | Register
Static Concept - Discussion Page For Q.2934 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Static Concept > Questions and Answers

Exercise:

Section 1

Q: class c{
Int I;
Static void test1()
{
System.out.println(“test1”);
}
Static void tes2t()
{
System.out.println(“test1”);
}

}
A. compile time error B. runtime exception
C. test1 test2  D. no output

Answer and Explanation

Answer:runtime exception

Explanation:
here we declared static method not SIB, JVM try to execute but there is no main() method so it will throw runtime exception

Comment on this Question

Name:

Loading...




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