JAVA Variables and Scope

JAVA Variables and Scope :

  • JAVA Variables and Scope
  • Java Contains three types of variables
    • Instance Variables
    • Static Variables
    • Local Variable
  • Life span of static variables is till the JVM or application shuts down
  • Life time of Instance variables is till the Object lives.
  • The life span of local variable is till it reaches the end of the method.
  • Instance variable and Static variables are initialized be default, where as Local Variables are not initialized.
  • Local variables must be initializing before using it.
  • Static variables must be declared in class general area.
  • It must not be declared in constructor, blocks and methods.
  • Local Variables have only one modifier, which is FINAL.

If You need more visit our site – www.iguddy.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s