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

Which package is imported by default?

1088


What is the role of garbage collector in java?

972


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

962


is there a separate stack for each thread in java? : Java thread

987


Can a static class implement an interface?

1132


What is string manipulation?

1012


What is the difference between length and size in java?

997


What are the different approaches to implement a function to generate a random number?

1065


What is main function purpose?

1042


How do you make an arraylist empty in java?

937


How variables are stored in memory?

1006


Is space a char?

933


What is the difference between a constructor and a method?

1265


How can constructor chaining be done by using the super keyword?

1096


Can we overload final method in java?

993