Home » How to reverse ArrayList in Java

How to reverse ArrayList in Java

by Online Tutorials Library

How to reverse ArrayList in Java?

The reverse method of Collections class can be used to reverse any collection. It is a static method. Let’s see the signature of reverse method:

Let’s see a simple example to reverse ArrayList in Java:

Output:

Before Reversing [Mango, Banana, Mango, Apple] After Reversing [Apple, Mango, Banana, Mango] 

You may also like