As we all know that java uses the following data types
byte Occupy 8 bits in memory
short Occupy 16 bits in memory
int Occupy 32 bits in memory
long Occupy 64 bits in memory
If I create a class like
class Demo{
byte b;
int i;
long l;
}
Demo obj = new Demo();
Now my question is obj
size is < or > or =
the size of b+i+l
which is 104 bytes
. Please give me the clarification with proper reason.
Thanks,
Anil Kumar C
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…