开发者

How is a Java object constructed?

If I create a class like:

public class Test{
       int id;
       String name;
}

Now, i开发者_运维问答f I have to use the class, we have to just create a instance of the class as

Test testObj = new Test();

I would like to know how the actual object is created in the system. (In core level, what will be the structure of the object.)


This depends on the actual virtual machine (vendor, version). There's no detailed specification on how a VM should store the instance.

The Java virtual machine does not mandate any particular internal structure for objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜