Tuesday, 15 July 2014

INSTANCE VARIABLE
  • Instance variables declared inside class but not inside methods.
  • They live inside the object they belong to.
Public class Duck {
int size ;
}

LOCAL VARIABLE

  • Local variables are declared inside methods including method parameters.
  • They are temporary and live long as method in the stack.
public void foo(int x)
{
int i=x+3;
Boolean b= true;
}

Categories

Unordered List

Sample Text

nazar. Powered by Blogger.

Popular Posts

.

Recent Posts

Text Widget