Skip to content

Category Archives: Java Programs

When elements get from the HashMap due to hashing the order they inserted is not maintained while retrieval. We can achieve the given task using… Read More
In this article, we will learn how to compare two HashMap objects in Java. In java.util package HashMap class is present. HashMap is used to… Read More
Bob is a small kid and just learned to count numbers. He sat in his house and started playing with his number of toys. He… Read More
Convert Milliseconds to Minutes and Seconds in java using methods like toMinutes() and toSeconds(), TimeUnit which is in the concurrent package. Milliseconds: 1 millisecond =… Read More
Data structures of two types of Linear Data Structure and the second is Non-linear Data Structure the main difference between these Data structures is the… Read More
Octal is a number system where a number is represented in powers of 8. So all the integers can be represented as an octal number.… Read More
The string is a sequence of characters. In java, objects of String are immutable. Immutable means that once an object is created, it’s content can’t… Read More
For printing months in different formats, we are going to use two classes of java.util package. That is the first one Calendar class and another… Read More
LinkedTransferQueue is a queue that orders elements FIFO (first-in-first-out) with respect to any given producer. The head of the queue is that element that has… Read More
HashMap<K, V> is a Java Collection and is a part of java.util package. It provides the basic implementation of the Map interface of Java. It… Read More
A Savepoint object is used to save the current state of the database which can be rolled-back afterwards to that state of the database. Savepoints… Read More
Java provides two interfaces to sort objects using data members of the class which are Comparable and Comparator. In this article, we will focus on… Read More
HashMap is similar to the HashTable, but it is unsynchronized. It allows to store the null keys as well, but there should be only one… Read More
HashMap and Hashtable are used to store data in key and value form using a hashing technique to store unique keys. To copy Map content… Read More
We can get the System name for a Windows or Linux machine using the getHostName() method of the InetAddress class of java.net package after getting… Read More