Aishwarya Naglot has Published 180 Articles

How do you find the element of a LinkedList in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 13:32:16

1K+ Views

A Linked list is a linear type of data structure that is used to store a group of elements. It is a part of the Java Collections Framework. A LinkedList is made up of nodes, where each node contains a data field and a reference to the next node in ... Read More

How do you get the index of an element in a list in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 12:36:24

21K+ Views

List is a collection in Java that allows us to store elements. In this article, we will learn how to get the index of an element in a List in Java. We have various ways to get the index of an element in a List in Java. They are - ... Read More

How do you make a list iterator in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 12:29:16

363 Views

List Iterators in Java are mainly useful for traversing a list in both directions (forward and backward). They allow you to iterate through the elements of a list while providing methods to modify the list during iteration. In this article, we will learn how to create or make a list ... Read More

How do you create an empty list in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 12:03:59

52K+ Views

A list is an ordered collection that holds a sequence of elements. In Java, a list is represented by the List Interface of the java.util package. This provides various methods to maintain and manipulate the list.To create a list, you need to instantiate any of the implementing classes of this interface, ... Read More

Java program to reverse a string using recursion

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 12:03:38

2K+ Views

In this article, we will learn to reverse a string using recursion in Java. Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is known as a recursive call of the ... Read More

Java program to reverse a string using stacks

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Jun-2025 11:53:14

2K+ Views

Stack is a linear data structure where we can store elements. It uses the LIFO (last in, first out) principle, which means the item we add last will be the first one to be removed. In this article, we will understand how to reverse a string using stacks. Let's take ... Read More

Java program to replace a character at a specific index

Aishwarya Naglot

Aishwarya Naglot

Updated on 30-May-2025 18:47:21

4K+ Views

In this article, we'll learn how to replace a character at a specific index in a string. Strings in Java are sequences of characters enclosed in double-quotes (" "). We use strings to represent text in our programs. Problem Statement You are given a string, an index, and a character. ... Read More

How do you make a shallow copy of a list in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 30-May-2025 18:35:52

904 Views

In this article, we will learn how to make a shallow copy of a List in Java. What is the List in Java? List is a part of the Java collection framework. It stores elements sequentially and also allows us to store duplicate elements. It is an interface, not a ... Read More

How do you search for an element in an ArrayList in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 30-May-2025 18:29:25

7K+ Views

In this article, we will learn how to search for an element in an ArrayList in Java. ArrayList is an interface that extends another interface called the List interface. It provides a way to store elements and also provides resizable functionality. Let's take an example: Input: [1, 2, 3, 4, ... Read More

How do you turn an ArrayList into a Set in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 30-May-2025 18:10:34

11K+ Views

In this article, let's learn how to convert an ArrayList into a Set in Java. ArrayList is a collection that allows us to store duplicates, whereas Set is a collection that does not allow duplicates. So, when we convert an ArrayList to a Set, all the duplicate elements will be ... Read More

Advertisements