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
Does java return by reference?
Why set do not allow duplicates in java?
Why for each loop is used?
How do you convert string to int in java?
What are the Class Libraries ?
Can a class be private?
What is substring in java?
What is the difference between a constructor and a method?
What language is java written?
What is the abstraction?
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.
What are the advantages of autoboxing?
How we can declare a static variable?
What does isempty () do in java?
Can an integer be null java?