Friday, January 11, 2008

Size of Empty class

CONCEPT:
Object has a unique state, behaviour and identity.

class Empty { };
The size of an object of empty class is one byte.
If was zero then array of 100 object would all be pointing to the same memory location.

Complexity: SIMPLE.

No comments: