While the HashMap class is not thread-safe and permits one null key, the Hashtable class is thread-safe and permits non-null keys and values only. The thread-safety the Hashtable class provides has a performance penalty. Thread-safe use of maps is also provided by the methods in the Collections class. Like the Vector class, the Hashtable class is also a legacy class that has been retrofitted to implement the Map interface.
Wednesday, July 13, 2011
Java Stuff
Java 1.5 features
--------------------
1.Enhanced for loop(for each for loop).
2.Enumeration( enum keyword)
3.Assertions added in java 1.5
4.AutoBoxing/Unboxing ( like wrapper classes . means automatic convert between primitive to String and vice-versa.)
5.Generics ( example: typed Collections, Set())
6.Varagrs (variable arguments) (example : for printf() function,allows variable number of different arguments)
7.StringBuilder class in jdk 1.5 (java.lang package)
8.Annotations.
--------------------
1.Enhanced for loop(for each for loop).
2.Enumeration( enum keyword)
3.Assertions added in java 1.5
4.AutoBoxing/Unboxing ( like wrapper classes . means automatic convert between primitive to String and vice-versa.)
5.Generics ( example: typed Collections, Set(
6.Varagrs (variable arguments) (example : for printf() function,allows variable number of different arguments)
7.StringBuilder class in jdk 1.5 (java.lang package)
8.Annotations.
Subscribe to:
Posts (Atom)