Java

349
4649 reads

February 25, 2013

HashTable-iterator


This example demonstrates Hashtable implementing iterators. Like the map classes, Hashtable does not directly support iterators.

101
2544 reads

February 25, 2013

Hash-table


This example describes Hashtable, that is integrated into the collections framework. It is

179
3576 reads

February 25, 2013

Stack-class


This example demonstrates Stack class.
Stack is a subclass of Vector that implements a standard last-in, first-out stack. Stack

310
3417 reads

February 25, 2013

Vector class-array


Vector implements a dynamic array. It is similar to ArrayList, but with two differences:
Vector is synchronized, and it contains many legacy methods that are not part of the collections framework.

135
2390 reads

February 25, 2013

Generic-collections


In this example the two versions are shown to defining generic classes with collections.
The first one(in comment) will give compile time error because of it was a legacy syntax.

144
2379 reads

February 25, 2013

Arrays-class Operation


Java 2 added a new class to java.util called Arrays. This class provides various
methods that are useful when working with arrays. Although these methods technically

153
2507 reads

February 24, 2013

collection-algorithm


The collections framework defines several algorithms that can be applied to collections
and maps. These algorithms are defined as static methods within the Collections class.

324
4709 reads

February 24, 2013

comparator-by accountname


This example demonstrates full implementation of custom-comparator.
This program describes more practically TreeMap class that store account balances.

23
2579 reads

February 24, 2013

Custom-comparator


This example describes a custom comparator. If you want to order elements a different way, then specify a Comparator object when you construct the set or map.

199
4580 reads

February 24, 2013

Tree-map


This example demonstrates the use of TreeMap class that implements the Map interface by using a tree.