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
What type of language is java?
What is singleton service?
Explain about serializable interface in java?
Can arraylist hold different types java?
What is quick sort in java?
What is difference between fail-fast and fail-safe?
Why is stringbuffer faster than string?
What is an array in java?
What is anagram of a string?
Can constructor be inherited?
What is the difference between hashmap and hashtable in java?
Can I learn java in 3 months?
What are the differences between throw and throws?
How to change the priority of thread or how to set priority of thread?
Write a function to find out longest palindrome in a given string?