Java Deque addAll() 方法

2025 年 3 月 22 日 | 阅读需 2 分钟

Java Deque 接口的 addAll() 方法用于将指定集合中的所有元素添加到 deque 的末尾。

指定者

  • Collection<E> 接口中的 addAll

语法

参数

上述方法只有一个参数

  1. 需要插入的元素“c”

返回

如果给定的 deque 已更改,则上述方法返回 true。

示例 1

输出

The marks for student1 : 
28
25
26
The marks for student2 : 
22
19
20
The total list for the marks : 
28
25
26
22
19
20

示例 2

输出

Enter the name of Employees for List 1: 
Sam
Ram 
Priya
Urvashi
Enter the name of Employees for List 2: 
Ravi
Rita 
Yashika
Lavish
The final list for the employees is given as : 
Sam
Ram
Priya
Urvashi
Ravi
Rita
Yashika
Lavish
下一主题Java Deque