Tech Me More

To quench our thirst of sharing knowledge about our day to day experience & solution to techincal problems we face in our projects.

Advertise with us !
Send us an email at

Wednesday, April 9, 2014

OCJP Practice question #8

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: