What is the size of the object in java

后端 未结 5 2006
半阙折子戏
半阙折子戏 2020-12-11 19:16

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         


        
5条回答
  •  爱一瞬间的悲伤
    2020-12-11 19:39

    Hard to say that will be the size of obj in memory, type size indication help the developers but actually in the memory it's a bit different. I advise you to read this article, it's really interesting.

提交回复
热议问题