Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 externalizable interface?

1100


Can list be final in java?

927


Why are constructors used?

1023


Why do we override tostring method in java?

961


Which sorting algorithm is best in java?

981


Explain importance of inheritance in java?

1022


How does java enable high performance?

1149


Can I declare class as static or private?

965


What types of index data structures can you have in java?

1232


Can a list be null in java?

1045


Compare Mutex and Semaphore in java.

1005


What is the static method?

1074


What is mnemonic code?

1017


Explain notifyall() method of object class ?

1088


What is the latest java version?

1059