众所周知,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
如果我创建一个类似以下的类:
class Demo{
byte b;
int i;
long l;
}
Demo obj = new Demo();
现在我的问题是,
obj
的大小是< 、> 或 =
b+i+l
的大小,而b+i+l的大小为104字节
。请给我适当的解释和理由。谢谢, Anil Kumar C