*
The moose likes Java in General and the fly likes Instance variables/local variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Instance variables/local variables" Watch "Instance variables/local variables" New topic
Author

Instance variables/local variables

Rakesh Ravindra
Greenhorn

Joined: May 02, 2005
Posts: 5
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


"Sun is Brown and Grass is Green"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

"rrr_java", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3431
    
  12
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.


Joanne
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Our naming policy requires two names, and the second one can not be an initial.


[Jess in Action][AskingGoodQuestions]
Rakesh Ravindra
Greenhorn

Joined: May 02, 2005
Posts: 5


Thanks for posting the link!

-- changing my name again.
 
Don't get me started about those stupid light bulbs.
 
subject: Instance variables/local variables
 
Similar Threads
Ajax callback doesn't initiate the servlet variable?
assigning a final value to a method local variable
Self Test Answer in K&B
Anonymous inner Classes accessing final variables
Variables in Java