Home » Core Java » util » Set


Java Sorted Set Example

In this example we shall show you how to make use of Java Sorted Set. Java Sorted Set is a Set that further provides a total ordering on its elements. The elements are ordered using their natural ordering, or by a Comparator typically provided at sorted set creation time. All elements inserted into a sorted set must implement the Comparable interface (or ...

Read More »

Java Set Example

In this example we will demonstrate the use of the interface Set, which is part of the Java Collections Framework. It extends the interface Collection so that all elements contained have no dublicates and only one null element may appear. There are several classes implementing the interface, such as AbstractSet, EnumSet, HashSet, LinkedHashSet, TreeSet and ConcurrentSkipListSet. The classes HashSet and ...

Read More »