How can we find size of the object ?
Answer Posted / m!r@
public class FindSizeOfObject{
public static void main(String[] args) throws Exception{
Runtime obj = Runtime.getRuntime();
System.out.println(obj.totalMemory() - obj.freeMemory());
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can a class with private constructor be extended?
What the difference is between execute, execute Query, execute Update?
What are the advantages of defining packages in java?
How to implement a multithreaded applet?
What is module in oop?
Which is better stringbuffer or stringbuilder?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
Can a set contain duplicates?
Why is string buffer better than string ?
What is the basic of java?
What is a classloader in java?
Can you access non static variable in static context?
Is char * a string?
What is meant by 'Class access modifiers'?