Wednesday, April 9, 2014

OCJP Practice question #8

3:40 PM

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

0 comments :

Post a Comment

 

© 2014 DieHardTechy . All rights resevered. Designed by Diehardtechy