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


Please Help Members By Posting Answers For Below Questions

What is the difference between throw and throws in java?

799


What is a local class in java?

817


What are data types in programming?

776


What do you know about the garbate collector?

810


Which is faster set or list in java?

810


Can a method be overloaded based on different return type but same argument type?

752


Explain about instanceof operator in java?

821


how is final different from finally and finalize in java?

827


How is Object Oriented Programming different from Procedure Oriented Programming?

828


What is sortedset in java?

795


What is a short in java?

721


Where pragma is used?

835


List types of storage classes in java?

848


What is unicode used for?

840


What is the final class?

758