Welcome Guest | Sign in | Register
Flow Control - Discussion Page For Q.2791 | 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,j;
i=j;
System.out.println(i);
}
}
A. compile time error B. run time error
C. no output D. 0

Answer and Explanation

Answer:compile time error

Explanation:
here I and j variable is a local variable , local variable should be initialized before the use , but they are trying to assign value of j to I without initializing ,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.