众所周知,java使用以下数据类型
byte Occupy 8 bits in memory
short Occupy 16 bits in memory
int Occupy 32 bits in memory
long Occupy 64 bits in memory
Run Code Online (Sandbox Code Playgroud)
如果我创建一个类似的
class Demo{
byte b;
int i;
long l;
}
Demo obj = new Demo();
Run Code Online (Sandbox Code Playgroud)
现在的问题是obj大小< or > or =尺寸b+i+l是104 bytes.请以正当理由给我澄清.
谢谢,
Anil Kumar C.