Home » Java » How does class object relation work?

How does class object relation work?

Posted by: admin August 10, 2018 Leave a comment

Questions:

What happens when we create an instance of a class? I mean, will every field and method of that class be inside that object (with allocated memory) or will it not have anything inside and have a reference to its class, instead. (First option looks like a waste of memory.)

Answers: