Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I think all instance variables including "final" ones are created on heap along with the object. The Jave Virtual Machine Specification as well as Java Language Specification has specifically mentioned about class constant pools when they talk about static final variables. But in case of object creation they always say, "New object contains new instances of all fields declared in the class...". One more thing is that even if the variable is declared as final it is still instance variable so it should be created along with the object and then heap is the proper place not the constant pool of the class. Thanx Replies: |
Sponsored Links
|