Welcome Guest | Sign in | Register
Flow Control - Discussion Page For Q.2796 | 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[]){
Int i=10;
System.out.println(i);
int j=20;
System.out.println(j);
}
}
A. compile time error B. run time error
C. no output D. 10 20

Answer and Explanation

Answer:10 20

Explanation:
here I and j variable is a local variable , local variable should be initialized before the use , here they are initializing and using it so it will display normal output.

Comment on this Question

Name:

Loading...




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