Aishwarya Naglot has Published 180 Articles

How to remove all whitespace from String in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 24-Jun-2025 13:03:06

8K+ Views

In this article, we will learn how to remove all whitespace from a string in Java. For example, if the given string contains white spaces as shown below - Initial String = "Hi how are you Welcome to Tutorialspoint.com" The output should contain a string without white spaces as ... Read More

Java program to get minimum and maximum from a list

Aishwarya Naglot

Aishwarya Naglot

Updated on 24-Jun-2025 12:51:19

1K+ Views

Minimum and Maximum Values of a ListA list is an ordered collection that allows us to store and access elements sequentially. It contains index-based methods to insert, update, delete, and search the elements. It can also have duplicate elements. The following are the ways to get the minimum and maximum ... Read More

Java Program to Shuffle the Elements of a Collection

Aishwarya Naglot

Aishwarya Naglot

Updated on 24-Jun-2025 12:37:37

368 Views

The Collection is a framework that provides an architecture to store and manipulate a group of objects. In Java, Collections can perform all the operations that you perform on data, such as searching, sorting, insertion, manipulation, and deletion. In this article, we will learn how to shuffle the elements ... Read More

Java Program to Get key from HashMap using the value

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 16:36:37

6K+ Views

Java HashMap is a hash table-based implementation of Java's Map interface. It is a collection of key-value pairs. In this article, we will understand how to get a key from a HashMap using the value. Following are the ways to get a key from a HashMap using the value: ... Read More

Java Program to Check if a set is the subset of another set

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 16:27:32

1K+ Views

In this article, we will understand how to check if a Set is a subset of another set. A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate ... Read More

Java Program to Pass ArrayList as the function argument

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 16:25:40

4K+ Views

The ArrayList is a resizable array, which is part of java.util package. The difference between a built-in array and an ArrayList in Java is that the size of an array cannot be modified. In this article, we will understand how to pass an ArrayList as a function argument. Following are the ways ... Read More

Java Program to Convert the local Time to GMT

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 16:23:01

3K+ Views

In this article, we will learn how to convert the local time to GMT (Greenwich Mean Time) in Java. We need this conversion when we want to standardize time across different time zones or when working with systems that require GMT. We will cover the following methods to convert local ... Read More

How do I empty a list in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 16:16:52

910 Views

List Interface is a collection in Java that is used for storing elements in a sequence. It also allows us to save duplicates as well as null values. In this article, we will learn how to empty a list in Java. Following are the ways to empty a list in ... Read More

Java program to calculate the difference between two sets

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 13:11:52

1K+ Views

A Set is a Collection that cannot contain duplicate elements (same as the mathematical set abstraction). The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited. Finding the difference between two sets means finding the elements that are not similar in both ... Read More

Java program to update value of HashMap using key

Aishwarya Naglot

Aishwarya Naglot

Updated on 18-Jun-2025 12:24:28

880 Views

HashMap is a part of the Java Collections Framework, and it is used for storing key-value pairs. In this article, we will see how to update the value of a HashMap using a key. We will use following methods to update the value of a HashMap: ... Read More

Previous 1 ... 5 6 7 8 9 ... 18 Next
Advertisements