Welcome Guest | Sign in | Register
Variables and Loops - Discussion Page For Q.2975 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Variables and Loops > Questions and Answers

Q: You have two class files name Test.class and Test1.class inside
javaproject directory.
Test.java source code is :
public class Test{
public static void main (String[] args){
System.out.println("Hello Test");
}
}
Test1.java source code is :
public class Test1{
public static void main (String[] args){
System.out.println("Hello Test1");
}
}
you have issued below commands from command prompt.
cd javaproject
java Test Test1

What is the output ?
A. Hello Test B. Hello Test Hello Test1
C. Hello Test1 D. Run fails - class not found

Answer and Explanation

Answer:Hello Test

Explanation:
You must specify exactly one class file to execute. If more than one then first one will be executed.

Comment on this Question

Name:

Loading...




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