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 split return?
What is serialversionuid?
give an example for encapsulation?
What is meant by binding in rmi?
What is one third plus one third as a fraction?
What are "methods" and "fields"?
Describe the Big-O Notation.
What is a protected method?
What is the use of http-tunneling in rmi?
What is the difference between quicksort & mergesort? When should they be used? What is their running time?
Can we sort set in java?
What is instance means in java?
What are recursive functions?
What is 16 bits called?
What is the difference between stringbuffer and stringbuilder class?