Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
JavaDevelopRep
Java
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
Java
/
day18
/
day18总结.txt
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
70 lines (69 loc) · 1.7 KB
master
Breadcrumbs
Java
/
day18
/
day18总结.txt
Copy path
Top
File metadata and controls
Code
Blame
70 lines (69 loc) · 1.7 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
1:Map(掌握)
(1)Map的特点
是由键和值组成的。每一个元素是一个键值对,由两部分组成。
键唯一,值可以重复。
它的实现类的数据结构只针对键有效,跟值无关。
(2)Map和Collection的区别?
A:Map双列集合,由键值对组成;键唯一,值可以重复;数据结构针对键有效
B:Collection单列集合,有单个元素组成;Set唯一,List可重复;数据结构针对元素有效
(3)Map的功能概述(自己补齐方法和中文意思)
A:添加功能
put
B:移除功能
remove
clear
C:判断功能
containsKey,containsValue
isEmpty
D:获取功能
size
get
keySet
values
entrySet
(4)Map的遍历
A:根据键找值
获取所有键的集合
遍历键的集合,得到每一个键
根据键找值
B:根据键值对对象找键和值
获取所有的键值对对象的集合
遍历键值对对象的集合,得到每一个键值对对象
根据键值对对象获取键和值
(5)HashMap
HashMap<String,String>
HashMap<Integer,String>
HashMap<String,Student>
HashMap<Student,String>
(6)LinkedHashMap
键有序,唯一
(7)TreeMap
TreeMap<String,String>
TreeMap<Student,String>
(8)面试题
A:HashMap和hashtable的区别?
HashMap非同步,不安全,效率高
线程是否安全
是否允许null键和值
B:List,Set,Map是否都继承自Collection
C:你所知道的常见集合类有哪些?常见功能有哪些?
ArrayList,HashSet,HashMap
(9)案例:
A:统计字符串中每个字符出现的次数
B:集合的嵌套遍历
2:Collections(理解)
(1)Collections是针对集合进行操作的工具类
(2)面试题:Collection和Collections的区别
A:Collection是单例集合的顶层接口,定义了单例集合的共性功能
B:Collections是针对集合进行操作的工具类
(3)Collections常见功能(自己补齐方法名称)
A:排序
B:二分查找
C:最大值
D:反转
E:随机置换
(4)案例:
A:ArrayList存储自定义对象并按照规则排序
ArrayList可以排序的,并且可以去掉重复元素的。
B:模拟斗地主洗牌和发牌
C:模拟斗地主洗牌和发牌并对牌进行排序
You can’t perform that action at this time.