Welcome Guest | Sign in | Register
Flow Control - Discussion Page For Q.2795 | 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);
int I;

}
}
A. compile time error B. run time error
C. no output D. 10

Answer and Explanation

Answer:compile time error

Explanation:
here I variable is a local variable , local variable should be initialized before the use , but they are trying to use before declaring ,that’s why it is throwing compile time error.

Comment on this Question

Name:

Loading...




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