File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60046
    
  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: 3165
    
  10
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: 24166
    
  30

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance variables/local variables
 
Similar Threads
Anonymous inner Classes accessing final variables
assigning a final value to a method local variable
Self Test Answer in K&B
Variables in Java
Ajax callback doesn't initiate the servlet variable?