| Author |
Constructer variables
|
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
|
|
|
what is the scope of variables declared inside constructer...... and where does the constructers occupy memory whether in heap or stack....
|
Creativity is nothing but Breaking Rules
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
|
Variables declared inside a constructor work exactly the same as local variables declared in a method. The scope is ofcourse the enclosing block (which might be the constructor itself). Variables are allocated on the stack, and objects are always allocated on the heap.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
|
|
thanks very much ...
|
 |
 |
|
|
subject: Constructer variables
|
|
|