Posted on May 15, 2007 by sharat
1.What is meant by compatible equals() and hashCode() methods ? In order for the Java Collections to work properly (and everything else in Java), the equals() and hashCode() methods must be compatible. Here, compatible means that if equals() reports that two instances are the same, then the hashCode() of both instances must be the same [...]
Filed under: Collection | 2 Comments »
Posted on May 15, 2007 by sharat
1.How to find the maximum size of heap used in the memory in java ?maxMemory(): Returns the maximum amount of memory that the Java virtual machine will attempt to use totalMemory(): Returns the total amount of memory in the Java virtual machine. Also you can use -Xmx parameter to set the max heap size.
2.What [...]
Filed under: Collection | 1 Comment »