Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance variables/local variables

 
Rakesh Ravindra
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

can anyone help me in understanding the compiler rule of initializing the local variables before using it.
What was the logic behind implementing this rule? why can't the compiler assumes default values as it works for instance variables.

Excuse me if this is already answered question bcoz i am bit lazy to search previous posts.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rrr_java", please check your private messages for an important administrative matter.
 
Joanne Neal
Rancher
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rrr_java:
Excuse me if this is already answered question bcoz i am bit lazy to search previous posts.


I'm a bit lazy myself and so find it easier to just post this link than to tell you the answer.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our naming policy requires two names, and the second one can not be an initial.
 
Rakesh Ravindra
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks for posting the link!

-- changing my name again.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic