What will be the output of the following
Java Program ?
Answer :
- option 1 is correct because int k is a local variable which needs to be initialized before using in the System.out.println(k); statement.
- Local variables have no default value whereas class level variable have.
More Question here : OCJP
No comments:
Post a Comment