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

Java – Convert a LinkedList to ArrayList

Last Updated: September 11, 2022 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]

Tags: Collections, Java-ArrayList, Java-LinkedList

Java – Convert Vector to ArrayList example

Last Updated: May 23, 2024 by Chaitanya Singh | Filed Under: java

In this article, we will write a Java program to convert Vector to ArrayList. In Java, both Vector and ArrayList implement the List interface and… [Read More]

Tags: Collections, Java-ArrayList, Java-Vector

Java ArrayList set() Method

Last Updated: June 12, 2024 by Chaitanya Singh | Filed Under: java

Java ArrayList set() method is used to replace an existing element present in the ArrayList at the specified position with the new given element. The… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList trimToSize() Method

Last Updated: June 12, 2024 by Chaitanya Singh | Filed Under: java

The trimToSize() method of ArrayList class is used for memory optimization. It trims the capacity of ArrayList to the current list size. This method is… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList remove(Object obj) Method example

Last Updated: June 1, 2024 by Chaitanya Singh | Filed Under: java

In this guide, you will learn how to remove a specified element from an ArrayList using remove() method. The method remove(Object obj) removes the first… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList remove(int index) Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

Method remove(int index) is used for removing an element of the specified index from a list. It removes an element and returns the same. It… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList lastIndexOf(Object 0bj) Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

The method lastIndexOf(Object obj) returns the index of last occurrence of the specified element in the ArrayList. It returns -1 if the specified element does… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList isEmpty() Method example

Last Updated: June 12, 2024 by Chaitanya Singh | Filed Under: java

The isEmpty() method of java.util.ArrayList class is used to check whether the list is empty or not. This method returns a boolean value. It returns true if… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList ensureCapacity() Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

ArrayList internally implements growable dynamic array which means it can increase and decrease its size automatically. If we try to add an element to a… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList indexOf() Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

Java.util.ArrayList class method indexOf(Object o) is used to find out the index of a particular element in a list. Method indexOf() Signature public int indexOf(Object… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList get() Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

ArrayList get(int index) method is used for fetching an element from the list. We need to specify the index while calling get method and it… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList contains() Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

ArrayList contains() method is used for checking the specified element existence in the given list. public boolean contains(Object element) It returns true if the specified… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList addAll(int index, Collection c) Method example

Last Updated: November 3, 2022 by Chaitanya Singh | Filed Under: java

In the last tutorial we have shared the example of addAll(Collection c) method which is used for adding all the elements of Collection c at the… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList addAll(Collection c) Method example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

In this tutorial we will see the usage of addAll() method of java.util.ArrayList class. This method is used for adding all the elements of a… [Read More]

Tags: Collections, Java-ArrayList

Java ArrayList add(int index, E element) example

Last Updated: September 11, 2022 by Chaitanya Singh | Filed Under: java

Simple add() method is used for adding an element at the end of the list however there is another variant of add method which is… [Read More]

Tags: Collections, Java-ArrayList

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

Java Tutorial

Java Introduction

  • Java Index
  • Java Introduction
  • History of Java
  • Features of Java
  • C++ vs Java
  • JDK vs JRE vs JVM
  • JVM - Java Virtual Machine
  • First Java Program
  • Variables
  • Data Types
  • Operators

Java Flow Control

  • Java If-else
  • Java Switch-Case
  • Java For loop
  • Java while loop
  • Java do-while loop
  • Continue statement
  • break statement

Java Arrays

  • Java Arrays

OOPs Concepts

  • OOPs Concepts
  • Constructor
  • Java String
  • Static keyword
  • Inheritance
  • Types of inheritance
  • Aggregation
  • Association
  • Super Keyword
  • Method overloading
  • Method overriding
  • Overloading vs Overriding
  • Polymorphism
  • Types of polymorphism
  • Static and dynamic binding
  • Abstract class and methods
  • Interface
  • Abstract class vs interface
  • Encapsulation
  • Packages
  • Access modifiers
  • Garbage Collection
  • Inner classes
  • Static import
  • Static constructor

Java Exception Handling

  • Exception handling
  • Java try-catch
  • Java throw
  • Java throws
  • Checked and Unchecked Exceptions
  • Jav try catch finally
  • Exception Examples
  • Exception Propagation

Collections Framework

  • Collections in Java
  • Java ArrayList
  • Java LinkedList
  • Java Vector
  • Java HashSet
  • Java LinkedHashSet
  • Java TreeSet
  • Java HashMap
  • Java TreeMap
  • Java LinkedHashMap
  • Java Queue
  • Java PriorityQueue
  • Java Deque
  • Comparable interface
  • Comparator interface
  • Collections Interview Questions

MORE ...

  • Java Scanner Class
  • Java 8 Features
  • Java 9 Features
  • Java Conversion
  • Java Date
  • Java Multithreading
  • Java I/O
  • Java Serialization
  • Java Regex
  • Java AWT
  • Java Swing
  • Java Enum
  • Java Annotations
  • Java main method
  • Java Interview Q

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap