Home > DeveloperSection > Interviews > What are local and instance variables in Java ?

Posted on    November-24-2015 6:46 AM

 Java Java 
 1 Answer(s)
  468  View(s)
Rate this:

Devesh Kumar Singh

Total Post:12

Posted on    November-24-2015 7:46 AM

Local variables are those which are declared within a block of code like methods. Local variables should be initialized before accessing them, whereas

Instance variables are those which are defined at the class level. Instance variables need not be initialized before using them as they are automatically initialized to their default values.

Don't want to miss updates? Please click the below button!

Follow MindStick