title: What is the size of the object in java
body: <p>As we all know that java uses the following data types</p>
  
  <pre><code>byte    Occupy 8 bits in memory
  short   Occupy 16 bits in memory
  int     Occupy 32 bits in memory
  long    Occupy 64 bits in memory 
  </code></pre>
  
  <p>If I create a class like</p>
  
  <pre><code>class Demo{
      byte b;        
      int i;
      long l;
  }
  
  Demo obj = new Demo();
  </code></pre>
  
  <p>Now my question is <code>obj</code> size is <code>&lt; or &gt; or =</code> the size of <code>b+i+l</code> which is <code>104 bytes</code>. Please give me the clarification with proper reason.</p>
  
  <p>Thanks,<br>
  Anil Kumar C</p>