Welcome Guest | Sign in | Register
Flow Control - Discussion Page For Q.2765 | 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 test(){
System.out.println(“I am in test method”);
}

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


Public static void test1(){
System.out.println(“I am in test method”);
}
}

Which will print the output?
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, JVM will start execution from main method. and test() method or test1() 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.