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
When object is created and destroyed?
How to provide security in java
How to invoke external process in java.
What is mean by collections in java?
When arithmeticexception is thrown?
What are the five major types of reference sources?
What is the difference between static method and instance method in Java?
Explain the purpose of garbage collection in Java?
How would you convert bytes to string?
What are the differences between c++ and java?
Can a class extend more than one class?
Is finalize() similar to a destructor?
Is array passed by reference in java?
Similarity and difference between static block and static method ?
What is the multi-catch block in java?