当前位置: 首页 > news >正文

JDK 9 List.of(...)

		// JDK 9      写法: List.of(...)
//		List<Point> polygon = List.of(new Point(0, 0), new Point(0, 4), new Point(4, 4), new Point(4, 0));// JDK 1.6 写法:使用ArrayList并手动add元素List<Point> polygon = new ArrayList<Point>();polygon.add(new Point(0, 0));polygon.add(new Point(0, 4));polygon.add(new Point(4, 4));polygon.add(new Point(4, 0));

JDK 9 List.of(...)

JDK 1.6            boolean add(E e);

/*** Appends the specified element to the end of this list (optional* operation).** <p>Lists that support this operation may place limitations on what* elements may be added to this list.  In particular, some* lists will refuse to add null elements, and others will impose* restrictions on the type of elements that may be added.  List* classes should clearly specify in their documentation any restrictions* on what elements may be added.** @param e element to be appended to this list* @return <tt>true</tt> (as specified by {@link Collection#add})* @throws UnsupportedOperationException if the <tt>add</tt> operation*         is not supported by this list* @throws ClassCastException if the class of the specified element*         prevents it from being added to this list* @throws NullPointerException if the specified element is null and this*         list does not permit null elements* @throws IllegalArgumentException if some property of this element*         prevents it from being added to this list*/boolean add(E e);

http://www.dtcms.com/a/520131.html

相关文章:

  • 做一个vue3 v-model 双向绑定的弹窗
  • 为超过10亿条记录的订单表新增字段
  • 哪里做网站最便宜WordPress功能模块排版
  • 每日算法刷题Day78:10.23:leetcode 一般树7道题,用时1h30min
  • 薄膜测厚选CWL法还是触针法?针对不同厚度与材质的台阶仪技术选型指南
  • WPF-MVVM的简单入门(第一个MVVM程序)
  • blender拓扑建模教程
  • asp.net手机网站开发教程翻译网站建设方案
  • 佛山建设网站公司哪家好特斯拉ceo进厂拧螺丝
  • 如何做新网站保留域名wordpress基础
  • C# 实现 Modbus TCP 通信
  • 《Git:从入门到精通(七)——Git分支管理与协作开发实战》
  • 超越传统工具:利用Reddit发现关键词的独特视角与前沿方法
  • 数据结构——二叉搜索树深度解析
  • macOS 无法在根目录创建目录的原因与解决方案
  • 11.23 鸿蒙HTTP数据请求
  • 郑州网站建设最低价网址导航的意思
  • LOESS回归
  • 跨平台开发中的图形渲染:Canvas与View+CSS的性能分析与决策路径
  • 能源经济选题推荐:可再生能源转型政策如何提高能源韧性?基于双重机器学习的因果推断
  • 《R for Data Science (2e)》免费中文翻译 (第11章) --- Communication(1)
  • 生成式对抗网络 GAN:从零理解生成对抗网络的原理与魅力
  • 李宏毅机器学习笔记30
  • 做塑胶材料的网站深圳网站设计平台
  • 【设计模式】装饰器模式(Decorator)
  • 设计模式之:享元模式
  • android 图像显示框架二——流程分析
  • CentOS 10 系统安装
  • MySQL试验部署
  • 【文献笔记】ICLR 2018 | Graph Attention Networks