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 lock be acquired on a class in java programming?
What is constructor and its types?
how would you implement a thread pool? : Java thread
What is a singleton class in Java?
What is a default method?
Can you pass by reference in java?
Can a static method be final?
What are the advantages of exception handling in java?
What are the different conditional statements?
How do you compare two strings lexicographically?
Which number is denoted by leading 0x or 0x in java?
How transient variable is different from volatile variable?
What is java’s garbage collected heap?
What is the purpose of abstract class?
Where will it be used?