Hi friends,
I want to know that, a class implements two interfaces each containing three methods. The class contains no instance data. Anyone like to tell me what will be the size of the object created from this class?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 10, 2011, 6:55 AM
Every instance of an object requires 8 bytes (32 bit) or 16 bytes (64 bit) of overhead.
Even if there are no instance fields it also needs an additional byte as a marker. In practice, to maintain alignment, 4 or 8 bytes will be allocated instead of one.
Pankaj RanaPosted Dec 10, 2011, 6:44 AM
Sam HobbsPosted Dec 10, 2011, 5:36 AM