JAVA Tutorials

Searching Elements in List – Free Java Tutorials and online Training

Collections Class defines the following Binary Search methods to search the elements in a list. public static int binarySearch(List ls, Object obj): If the list is sorted according to default natural sorting order, then we have to use this method. public static int binarySearch(List ls, Object obj, Comparator c): We have to use this method if the …

Searching Elements in List – Free Java Tutorials and online Training Read More »

Arrays Class in Java – Free Java Tutorials and Online Training

Arrays Class is a utility class to define several utility methods for Arrays or Arrays objects. Here we discuss about the Arrays Class methods. Sorting elements of Array Arrays Class defines the following sort methods to sort elements of Primitive and Object type Arrays: public static void sort(primitive[] p): This method is used to sort elements …

Arrays Class in Java – Free Java Tutorials and Online Training Read More »

NavigableSet , NavigableMap and Collection Sort in Java

1.6 version enhancements in Collection Framework: As a part of 1.6 version, the following two concepts were introduced in Collection Framework: 1) Navigable Set 2) Navigable Map. Navigable Set It is the child interface of SortedSet and it defines several methods for Navigation purposes. Navigable Set Methods NavigableSet defines the following methods: floor(e): This method returns the highest …

NavigableSet , NavigableMap and Collection Sort in Java Read More »

Queue in Java – Free Java Tutorials and Online Training

Queue is the child interface of Collection Interface. Queue has mainly two types: 1) Priority Queue 2) Blocking Queue. Blocking Queue has two types 1) Priority Blocking Queue 2) Linked Blocking Queue. If we want to represent a group of individual objects prior to processing then we should go for queue. For example, before sending …

Queue in Java – Free Java Tutorials and Online Training Read More »

Hashtable in Java – Free Java Tutorials and Online Training

Introduction: HashTable , Hash table is basically an array of Lists. Each List is known as a bucket. The position of a bucket is identified by calling the hashcode() method. A Hashtable contains values based on the key. Hashtable Features: The underlying data structure for HashTable is HashTable itself. Insertion order is not preserved and it …

Hashtable in Java – Free Java Tutorials and Online Training Read More »