I have a question
What happend when I declare a variable inside a method, for example.
void myMethod() { Ship myShip = new Ship(); }
Where is allocated myShip reference, in stack or in the heap ?
I think in stack but I'm confused because I was reading in J2ME Game Programming book "Java classes are instantiated onto the Java heap"
All java clases ?
Thanks in advance
See Question&Answers more detail:os