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
What is the full name of java?
How do you use nextline in java?
What does java ide mean?
What is the use of http-tunneling in rmi?
How do you classify Dialog Box?
Explain the inheritance?
How does java pattern compile work?
Which is the class in java?
Write a function to print Fibonacci series and Tribonacci series?
What is meant by class loader? How many types are there?
Is empty string in java?
Which variables are stored in stack?
What does sprintf mean?
how come we know the object is no more used in the class?
How many characters is 16 bytes?