title: Byte in Java Takes 4 bytes by default?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/229886/size-of-a-byte-in-memory-java">Size of a byte in memory - Java</a>  </p>
  </blockquote>
  
  
  
  <p>I read this in an article. I am just pasting as is:</p>
  
  <blockquote>
    <ul>
    <li>The class takes up at least 8 bytes. So, if you say <code>**new Object();**</code> you will allocate 8 bytes on the heap.</li>
    <li>Each data member takes up 4 bytes, except for long and double which take up 8 bytes. Even if the data member is a byte, it will still take
    up 4 bytes! In addition, the amount of memory used is increased in 8
    byte blocks. So, if you have a class that contains one byte it will
    take up 8 bytes for the class and 8 bytes for the data, totalling 16
    bytes (groan!).</li>
    </ul>
  </blockquote>
  
  <p>Is it true Java byte allocates / takes 4 bytes? and empty class takes 8 bytes?
  Its confusing here as well.</p>