BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to Convert ArrayList to HashSet in Java

By Chaitanya Singh | Filed Under: java

There are several ways to convert ArrayList to HashSet. In this guide, we will discuss the following ways with examples: Passing ArrayList to constructor of… [Read More]

When to use ArrayList and LinkedList in Java

By Chaitanya Singh | Filed Under: java

In this guide, we will discuss, when to use ArrayList and when to use LinkedList in Java. There are multiple similarities between these classes. However… [Read More]

How to Increase the capacity of ArrayList

By Chaitanya Singh | Filed Under: java

When we create an ArrayList in Java, it is created with a default capacity of 10. However an ArrayList can be automatically resized if more… [Read More]

Perform Binary Search on ArrayList in Java

By Chaitanya Singh | Filed Under: java

In this tutorial, you will learn how to perform binary search on ArrayList in Java. 1. Perform binary search on ArrayList using Collections.binarySearch() In this… [Read More]

Add Multiple Items to an ArrayList in Java

By Chaitanya Singh | Filed Under: java

In this tutorial, you will learn how to add multiple items to an ArrayList in Java. 1. Add multiple items using adAll() method The addAll()… [Read More]

Difference between Array and ArrayList

By Chaitanya Singh | Filed Under: java

In this guide, we will discuss the difference between Array and ArrayList. What is an Array? An array is a collection of elements of similar… [Read More]

Difference between length of Array and size of ArrayList in Java

By Chaitanya Singh | Filed Under: java

In this tutorial, you will learn the difference between length of Array and size of ArrayList in Java.. Length of Array: // creating an array… [Read More]

How to make an ArrayList read only in Java

By Chaitanya Singh | Filed Under: java

A read only ArrayList means that no modification operations is allowed to be performed on ArrayList. This list cannot be modified by adding, removing or… [Read More]

Java – How to Convert a String to ArrayList

By Chaitanya Singh | Filed Under: java

In this java tutorial, you will learn how to convert a String to an ArrayList. Input: 22,33,44,55,66,77 Delimiter: , (comma) Output: ArrayList with 6 elements… [Read More]

How to remove duplicates from ArrayList in Java

By Chaitanya Singh | Filed Under: java

In this tutorial, you will learn how to remove duplicates from ArrayList. Example 1: Removing duplicates from ArrayList using LinkedHashSet In the following example, we… [Read More]

How to get the last element of Arraylist?

By Chaitanya Singh | Filed Under: java

There are times when we need to get the last element of an ArrayList, this gets difficult when we don’t know the last index of… [Read More]

Convert HashSet to a List/ArrayList

By Chaitanya Singh | Filed Under: java

In this tutorial we will be learning how to convert a HashSet to a List (ArrayList). Program Here we have a HashSet of String elements… [Read More]

Java – Convert a LinkedList to ArrayList

By Chaitanya Singh | Filed Under: java

Example In this example we are converting a LinkedList to ArrayList. We have a LinkedList of Strings in which we are storing names of 5… [Read More]

Java – Convert Vector to ArrayList example

By Chaitanya Singh | Filed Under: java

In last tutorial we shared how to convert Vector to Array. Here we are gonna see Vector to ArrayList conversion with example. Example In the… [Read More]

Java ArrayList set() Method example

By Chaitanya Singh | Filed Under: java

If there is a need to update the list element based on the index then set method of ArrayList class can be used. The method… [Read More]

  • 1
  • 2
  • 3
  • 4
  • Next Page »

Copyright © 2012 – 2022 BeginnersBook . Privacy Policy . Sitemap