type
status
date
slug
summary
tags
category
icon
password

正则

notion image

集合进阶

Collection

常用方法

notion image

遍历方式

notion image
notion image
补充一个:Alt + Enter 自动生成返回值变量
notion image
notion image
notion image

List

notion image

ArrayList

基于数组,顺序存储
第一次加数据扩容成10,后面每次扩容成1.5倍

LinkedList

基于链表,链式存储

泛型

泛型类

notion image

泛型方法

notion image
addAll方法可以这样,传任意个变量
notion image

泛型接口

notion image
  1. 给出具体类型
notion image
  1. 延续泛型
notion image

泛型的继承和通配符

  • 泛型不具备继承性质,但数据具备继承性
  • 通配符:
notion image
notion image
notion image

Set

Hashset

无序,不重复,无索引
继承Collection,可以用它的方法,没有什么新的方法,因为没有索引
创建时默认长度16,装载因子0.75,数组名table
notion image
装载的元素个数达到16*0.75 = 12个就扩容到原来的两倍
LinkHsahset
有序,不重复,不可排序(多了双链表)
TreeSet
不重复,无索引,可排序(不可以是对象,可以是Integer和Double)
notion image
notion image

Map集合(双列)

方法

notion image
notion image
notion image

Map遍历

notion image
notion image
notion image

可变参数

notion image

Collections工具类

notion image
notion image

Stream流(重要)

notion image
notion image

获取Stream流

notion image

Stream流中间方法(操作完后还是Stream流)

notion image

Stream流的终结方法

notion image
notion image

File-IO流

创建File对象

notion image
很多方法

IO

notion image
 
抽象类+接口随机森林算法讲解
Loading...