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

Home > Java Programming > Flow Control > Questions and Answers

Q: class A{
Public static void main(String args[]){
System.out.println(“I am in main method”);
}
Public static void test(){
System.out.println(“I am in test method”);
}
}

Which is true?
A. i am in main method B. i am in test method
C. i am in main method
i am in test method
D. i am in main method
i am in test method

Answer and Explanation

Answer:i am in main method

Explanation:
here the code which we have in main method will execute, test method is static memory will be allocated automatically ,as test method we are not calling from main method so it will not execute.

Comment on this Question

Name:

Loading...




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