About Java Hub

Java Learners Hub


Super friendly <br/>code & developer communities

Super friendly
code & developer communities

A place for coders and developers to share, learn and grow together.

Back to Hub

How can we get memory allocated to object when it is created? Is there any method as sizeOf() which is in CPP?

2      Reply

Java object allocation and construction are tied together, it is impossible to use an allocated but uninitialized object instance.

Java does not provide anything like C's sizeof()

Reply

Okk thank you