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.

Comments

HTML/JAVASCRIPT

Popular posts from this blog

Teradata SQL Assistant Shortcuts

How to List All Tables in Oracle, MySql, Teradata, DB2 and PostgreSQL

7473 Requested sample is larger than table rows. All rows returned