Java ArrayDeque clone方法 Java ArrayDeque clear方法 Java ArrayDeque contains方法 Java ArrayDeque clone方法 package com.codingdict; import java.util.ArrayDeque; import java.util.Deque; public class ArrayDequeDemo { public static void main(String[] args) { // create an empty array deque with an initial capacity ArrayDeque<Integer> deque1 = new ArrayDeque<Integer>(8); // use add() method to add elements in the deque deque1.add(15); deque1.add(30); deque1.add(20); deque1.add(18); // clone the first deque, Deque<Integer> deque2 = deque1.clone(); // let us print all the elements available in deque2 // now deque2 should have similar elements to deque1. for (Integer number : deque2) { System.out.println("Number = " + number); } } } Java ArrayDeque clear方法 Java ArrayDeque contains方法