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
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.