In that case compiler will embed its own constructor and class Object and its implementing interfaces variables (if any) will also inherited. So on the basis of .class file we can not find the size. Correct me if I am wrong.

On 6/17/2010 10:27 PM, Dainis Brjuhoveckis wrote:
Have you tried to create such class and compile it and then see the size of resulting .class file? :-)

On Thu, Jun 17, 2010 at 7:24 PM, Shiv Shankar <mca.shivshan...@gmail.com <mailto:mca.shivshan...@gmail.com>> wrote:

    Hi everyone,
      This look like silly questions, but I am confused and asking
    this questions. "What is size of an empty class ? ".
      We know in C/C++ its one byte. In java as there is no empty
    class (Object class inherited automatically), what will be the
    size of class if I am not providing any code in the class definition.
-- With Regards,
    Shiv Shankar

-- To post to this group, send email to
    javaprogrammingwithpassion@googlegroups.com
    <mailto:javaprogrammingwithpassion@googlegroups.com>
    To unsubscribe from this group, send email to
    javaprogrammingwithpassion+unsubscr...@googlegroups.com
    <mailto:javaprogrammingwithpassion%2bunsubscr...@googlegroups.com>
    For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en



--
With Regards,
Shiv Shankar

--
To post to this group, send email to javaprogrammingwithpassion@googlegroups.com
To unsubscribe from this group, send email to 
javaprogrammingwithpassion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to