Memory allocation in java

Posted by Girish on Stack Overflow See other posts from Stack Overflow or by Girish
Published on 2010-04-17T18:37:50Z Indexed on 2010/04/17 18:43 UTC
Read the original article Hit count: 272

Filed under:
class Someobject
{
  int i=10;
}

public class OtherObject
{
  public static void main(String args[])
  {
    Someobject obj=new Someobject();
    System.out.println(obj.i);
  }
}

Please tell me in which section of the memory:

  1. This entire code will load.
  2. Where will someobject will be stored.
  3. Where will obj will be stored
  4. Where will i be stored.

Thanks every one in advance.

© Stack Overflow or respective owner

Related posts about java