Close

Java Collections - ArrayDeque.addLast() Examples

Java Collections Java Java API 


Class:

java.util.ArrayDeque

java.lang.Objectjava.lang.Objectjava.util.AbstractCollectionjava.util.AbstractCollectionjava.util.CollectionCollectionjava.util.ArrayDequejava.util.ArrayDequejava.util.DequeDequejava.lang.CloneableCloneablejava.io.SerializableSerializableLogicBig

Method:

public void addLast(E e)

Inserts the specified element at the end of this deque. This method is equivalent to ArrayDeque#add().


Examples


package com.logicbig.example.arraydeque;

import java.util.ArrayDeque;

public class AddLastExample {

public static void main(String... args) {
ArrayDeque<Integer> ad = new ArrayDeque<>();
ad.add(1);
ad.add(2);
ad.addLast(10);
System.out.println(ad);
}
}

Output

[1, 2, 10]




See Also