class A
{
private int i;
}
class B extends A
{
private int i;
}

if I create an object of B class what will be the memory of that object.

Answer Posted / core java

In general we can't get the size of the object.
we Just cant think about this.Because the object is created
by **JVM**.Not by us.Internally some memory location is
allocated by the JVM.who we are talk about the object size.

but for out satisfication we are saying that some size
that depends on the variables only(primitive data types).

When object of the class B is created ,object of C and
object Of Object class are also created.Those properties
references are available in object of class B.

So we just can not think about the size of the object
really.

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is split return?

488


What is serialversionuid?

557


give an example for encapsulation?

580


What is meant by binding in rmi?

545


What is one third plus one third as a fraction?

485






What are "methods" and "fields"?

569


Describe the Big-O Notation.

613


What is a protected method?

593


What is the use of http-tunneling in rmi?

549


What is the difference between quicksort & mergesort? When should they be used? What is their running time?

653


Can we sort set in java?

537


What is instance means in java?

562


What are recursive functions?

571


What is 16 bits called?

495


What is the difference between stringbuffer and stringbuilder class?

567