Posted on June 2, 2008 by Subin
Can a Hashtable have a “null” key? Can a TreeSet hold a null? Confused?
Check the following table to know whether different data structures support null or not.
Collection Key Value
HashMap Yes [...]
Filed under: Advanced Java, Data Structures, Performance, Tips | No Comments »
Posted on September 14, 2007 by Subin
StringBuffer vs String
As we all know both String & StringBuffer are used to hold string (character sequence) values. The basic & the most important difference between the objects being created using String & StringBuffer : objects of String are immutable (means, no one can change it); but the objects created using StringBuffer are mutable. Consider [...]
Filed under: Advanced Java, Articles, Data Structures, Design, JVM & ByteCode, Performance, Tips | No Comments »
Posted on September 13, 2007 by Subin
When, where & how to use Vector & ArrayList
Even though both Vector & ArrayList are used for the same purpose - as a dynamic collection of related objects - there is a right time and place to use them. As we all know there is a major difference: Vector is thread-safe but ArrayList is not. [...]
Filed under: Advanced Java, Articles, Data Structures, Design, Performance, Tips | No Comments »
Posted on July 13, 2007 by Subin
Both TreeMap & HashMap are two different implementation of the Map interface. Even though this post is titled “TreeMap vs HashMap” I would like to say how they are connected and how much similar they are.
Both TreeMap & HashMap are not synchronized. To make it synchronized we have to explicitly call Collections.synchronizedMap( mapName ) . [...]
Filed under: Articles, Data Structures, Tips | No Comments »