Vector in Java

The Vector in Java is a class that implements a dynamic array. This means we can increase or decrease the size of the array dynamically. It is same like ArrayList in Java but has few differences. In this tutorial, we will understand in detail the Java Vector class, its implementation, …

Read more

TreeMap in Java

Java TreeMap is a class that implements the Map interface. It is a tree-based implementation that can store key-value data in sorted order efficiently. It is similar to HashMap but has a few differences which we will see towards the end of this tutorial. TreeMap in Java TreeMap stores values …

Read more

Hashtable in Java

Hashtable class in Java inherits the Dictionary class. Previously it was part of the java.util. From Java 2 onwards, it is part of the Collections framework since it can now implement the Map interface as well. It is similar to HashMap but has a few differences which we will see …

Read more

Dictionary in Java

Dictionary in Java is an abstract class in Java that stores the data in the form of key-value pairs. It is found in the java.util package and works similar to a Map. Each key has a value and we can retrieve the values in a Dictionary object using its corresponding …

Read more

Spliterator in Java

Java Spliterator is another type of Iterator interface to navigate through individual elements. As the name suggests, it supports Split and iteration together. This means we can perform parallel programming using Spliterator. Java Spliterator Spliterator was available from Java8 onwards. We can use it to iterate over both Collections and …

Read more

LinkedList in Java

LinkedList in Java is a linear data structure that is present in the java.util package. It is similar to ArrayList in Java and we can perform operations like adding an element, removing an element, etc. In this tutorial, we will understand about Java LinkedList. Java LinkedList Java LinkedList is a …

Read more

ListIterator in Java

ListIterator in Java is an interface that we use to navigate through a List collection in both directions. It extends the Iterator interface that we have learned in the previous tutorial. In this tutorial, we will discuss Java ListIterator with detailed examples. Java ListIterator Java ListIterator interface was available from …

Read more

Iterator in Java

Iterator in Java is an interface that is used to navigate through a collection to retrieve individual elements. A collection may be an ArrayList, LinkedList, HashSet, etc. It is a universal iterator that exists from Java 1.2. Prior to Java 1.2, we use Enumeration as an iterator. Due to several …

Read more

Java Custom Exceptions

Java allows us to create our own exceptions which we call as custom exceptions or user-defined exceptions. In the previous tutorial, we have learned how to use the throw keyword to throw our own exceptions. In this tutorial, we will learn how to create custom exceptions which we require based …

Read more

Java try with resources

Java 7 introduced a new way of closing the resources using Automatic resource management or try-with-resources. In this tutorial, we will learn in detail how to use try-with-resources. Java try-with-resources Java try-with-resources means declaring the resource within the try statement. A resource is nothing but closing or releasing an object …

Read more

Translate ยป