Blog Details

Java Collections & Java Arrays Methods

1. Introduction

Java offers two types of constructs where you can store multiple values or objects of the same type: Arrays and Collections.

Arrays are objects which store multiple variables of the same type. It can hold primitive types as well as object references.

Collection of interfaces, classes which helps in storing and processing the data efficiently.

2. Java Utils Package contains two classes, which have rich functions to manipulate Arrays and Collection

Let’s look at the diagram below which contains the main functions in those two classes.

When you try to solve some coding challenges, it’s better to use the Java APIs, such as shuffle, swap, sort, max, binarySearch… Once you are familiar with those functions, it can help you a lot.