LinkedList公共布尔布尔offerLast(Object o)方法 (LinkedList public boolean offerLast(Object o) method)

  • This method is available in package java.util.LinkedList.offerLast(Object o).

    软件包java.util.LinkedList.offerLast(Object o)中提供了此方法。

  • This method is used to add a specified object at the back of the linked list.

    此方法用于在链接列表的后面添加指定的对象。

Syntax:

句法:

    public boolean offerLast(Object o){
}

Parameter(s):

参数:

We can pass only one object as a parameter in the method and that object will add at the back element of the linked list.

我们只能在方法中传递一个对象作为参数,并且该对象将添加到链接列表的back元素中。

Return value:

返回值:

The return type of this method is boolean that means this method returns true after execution.

该方法的返回类型为布尔值 ,这意味着该方法在执行后返回true。

Java程序演示LinkedList offerLast(Object o)方法的示例 (Java program to demonstrate example of LinkedList offerLast(Object o) method)

import java.util.LinkedList;
public class LinkList {public static void main(String[] args) {LinkedList list = new LinkedList();
// use add() method to add elements in the list
list.add(10);
list.add(20);
list.add(30);
list.add(40);
list.add(50);
//  Current list Output
System.out.println("The Current list is:" + list);
// Add new element at the back of the linked list
// using offerLast(Object o)
list.offerLast(60);
//  New list Output
System.out.println("The new List is:" + list);
}
}

Output

输出量

D:\Programs>javac LinkList.java
D:\Programs>java LinkList
The Current list is:[10, 20, 30, 40, 50]
The new List is:[10, 20, 30, 40, 50, 60]

翻译自: https://www.includehelp.com/java/linkedlist-public-boolean-offerlast-object-o-method-with-example.aspx

Java LinkedList公共布尔boolean offerLast(Object o)方法(带示例)相关推荐

  1. Java LinkedList公共布尔boolean offerFirst(Object o)方法(带示例)

    LinkedList公共布尔布尔offerFirst(Object o)方法 (LinkedList public boolean offerFirst(Object o) method) This ...

  2. Java LinkedList公共布尔提供(对象o)方法(带示例)

    LinkedList公共布尔提供(对象o)方法 (LinkedList public boolean offer(Object o) method) This method is available ...

  3. Java LinkedList公共int indexOf(Object o)方法(带示例)

    LinkedList公共int indexOf(Object o)方法 (LinkedList public int indexOf(Object o) method) This method is ...

  4. Java布尔类toString()方法及示例

    Syntax: 句法: public String toString(); public static String toString(boolean value); 布尔类toString()方法 ...

  5. java uuid静态方法_Java UUID equals()方法与示例

    java uuid静态方法 UUID类equals()方法 (UUID Class equals() method) equals() method is available in java.util ...

  6. Java StringBuffer char charAt(int index)方法与示例

    StringBuffer类char charAt(int index) (StringBuffer Class char charAt(int index)) This method is avail ...

  7. java中intvalue_Java Byte类intValue()方法的示例

    java中intvalue 字节类intValue()方法 (Byte class intValue() method) intValue() method is available in java. ...

  8. java中intvalue_Java Short类intValue()方法及示例

    java中intvalue 短类intValue()方法 (Short class intValue() method) intValue() method is available in java. ...

  9. java中intvalue_Java Float类intValue()方法与示例

    java中intvalue 浮动类intValue()方法 (Float class intValue() method) intValue() method is available in java ...

最新文章

  1. LINQ系列:LINQ to SQL Exists/In/Any/All/Contains
  2. c语言memset清空指向数组的指针_C语言中数组和指针的关系
  3. 一个设置ip的vbs脚本
  4. 前端做后台管理系统有前途吗_关于后台管理系统前端项目的思考
  5. 配置classpath,引入jar包
  6. 支付宝花呗接口接入php,支付宝小程序开通花呗接口,这是正式向微信小程序正式宣战?...
  7. mysql查找有小数点的数据_MySQL中查询中位数?
  8. NHK SHV 的 22.2 声道音频系统
  9. php.ini 设置内存,php.ini怎么进行内存设置
  10. 这个教人写出烂代码的项目在 GitHub 上火了...
  11. linux内核奇遇记之md源代码解读之六
  12. 大学生自学微信小程序云开发教程
  13. 洛谷P2757 [国家集训队]等差子序列
  14. 回答老板“明白了”,可真的明白了吗?
  15. Eureka自我保护机制原理及作用enable-self-preservation
  16. leetcode 1359. Count All Valid Pickup and Delivery Options(有效的快递序列数目)
  17. 技术人员帮助电商运营选择最合适的物流快递运输公司的5个切入点
  18. wtc6508bsi,键释放引发的问题分析及解决
  19. java实现词法分析器
  20. 删除list列表中的某一个元素的多种方法

热门文章

  1. 计算机视觉领域常见期刊和会议,计算机视觉领域常见期刊和会议
  2. linux如何加载镜像,linux可以加载iso镜像文件到启动项吗
  3. jenkins vue 打包特别慢_从零开始 使用VUE开发桌面客户端
  4. python numpy读取数据_大神教你python 读取文件并把矩阵转成numpy的两种方法
  5. 安卓system镜像分区_玩机爱好者想要的PT分区到底是什么?可以使现有的安卓系统更快!...
  6. 吴枫 python小课账号_无门槛速学编程——Python小短课,自上而下分而治之
  7. python3兼容python2 print_python 字符串 r raw Python2 和 Python3 的区别及兼容技巧
  8. 16速 java_不停歇的 Java 即将发布 JDK 16,新特性速览!
  9. java.io.file.sync_Java(25)IO流和File类
  10. 『收藏向 期末SSM课设救急』 教你从搭建到测试运行手撸一个SSM项目实战,附带源码,前端页面、解析和一般遇到的问题(排雷)