Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_java
提交
8f066970
S
skill_tree_java
项目概览
CSDN 技术社区
/
skill_tree_java
通知
43
Star
8
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_java
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8f066970
编写于
11月 18, 2021
作者:
CSDN-Ada助手
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
12章题目
上级
391bce2c
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
718 addition
and
20 deletion
+718
-20
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.json
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.json
+8
-0
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.md
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.md
+31
-0
data/2.Java中阶/10.注解/2.使用apt处理注解/config.json
data/2.Java中阶/10.注解/2.使用apt处理注解/config.json
+8
-0
data/2.Java中阶/11.Maven基础/config.json
data/2.Java中阶/11.Maven基础/config.json
+52
-2
data/2.Java中阶/11.并发/1.并发的定义/Abstract.json
data/2.Java中阶/11.并发/1.并发的定义/Abstract.json
+8
-0
data/2.Java中阶/11.并发/1.并发的定义/Abstract.md
data/2.Java中阶/11.并发/1.并发的定义/Abstract.md
+31
-0
data/2.Java中阶/11.并发/1.并发的定义/config.json
data/2.Java中阶/11.并发/1.并发的定义/config.json
+25
-0
data/2.Java中阶/11.并发/2.线程属性/Thread.json
data/2.Java中阶/11.并发/2.线程属性/Thread.json
+8
-0
data/2.Java中阶/11.并发/2.线程属性/Thread.md
data/2.Java中阶/11.并发/2.线程属性/Thread.md
+32
-0
data/2.Java中阶/11.并发/2.线程属性/config.json
data/2.Java中阶/11.并发/2.线程属性/config.json
+40
-0
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.json
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.json
+8
-0
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.md
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.md
+31
-0
data/2.Java中阶/11.并发/3.线程状态/config.json
data/2.Java中阶/11.并发/3.线程状态/config.json
+40
-0
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.json
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.json
+8
-0
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.md
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.md
+101
-0
data/2.Java中阶/11.并发/4.线程之间的协作/config.json
data/2.Java中阶/11.并发/4.线程之间的协作/config.json
+40
-0
data/2.Java中阶/11.并发/5.死锁/DeadLock.json
data/2.Java中阶/11.并发/5.死锁/DeadLock.json
+8
-0
data/2.Java中阶/11.并发/5.死锁/DeadLock.md
data/2.Java中阶/11.并发/5.死锁/DeadLock.md
+51
-0
data/2.Java中阶/11.并发/5.死锁/config.json
data/2.Java中阶/11.并发/5.死锁/config.json
+8
-0
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.json
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.json
+8
-0
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.md
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.md
+31
-0
data/2.Java中阶/11.并发/6.线程安全的集合/config.json
data/2.Java中阶/11.并发/6.线程安全的集合/config.json
+61
-0
data/2.Java中阶/12.Maven基础/MavenDesc.json
data/2.Java中阶/12.Maven基础/MavenDesc.json
+8
-0
data/2.Java中阶/12.Maven基础/MavenDesc.md
data/2.Java中阶/12.Maven基础/MavenDesc.md
+31
-0
data/2.Java中阶/12.Maven基础/MavenScript.json
data/2.Java中阶/12.Maven基础/MavenScript.json
+8
-0
data/2.Java中阶/12.Maven基础/MavenScript.md
data/2.Java中阶/12.Maven基础/MavenScript.md
+31
-0
data/2.Java中阶/9.注解/config.json
data/2.Java中阶/9.注解/config.json
+2
-18
未找到文件。
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"Apt.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/10.注解/2.使用apt处理注解/Apt.md
0 → 100644
浏览文件 @
8f066970
# Annotation Processing Tool
下列关于
`APT(Annotation Processing Tool)`
的说法正确的是:
## 答案
```
以上说法均正确
```
## 选项
### A
```
注解处理器,是javac的一种处理注释的工具
```
### B
```
自定义处理器都需要继承AbstractProcessor
```
### C
```
APT能够在编译期通过处理注解,生成我们想要的文件
```
data/2.Java中阶/10.注解/2.使用apt处理注解/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-8b0806d4d89948598ac95e5c19b53298"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[
"apt.json"
],
"title"
:
"使用apt处理注解"
}
\ No newline at end of file
data/2.Java中阶/11.Maven基础/config.json
浏览文件 @
8f066970
{
"node_id"
:
"java-a569056217524d5a8b6ed88fd678b73d"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[],
"children"
:
[
{
"Maven介绍"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-1fbf8f4636ed479aa87548441295c562"
,
"title"
:
"Maven介绍"
}
},
{
"依赖管理"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-76e9c3885d4145368c052419f60ecdb5"
,
"title"
:
"依赖管理"
}
},
{
"使用插件"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-43be29e168624aff939849f39630bca6"
,
"title"
:
"使用插件"
}
},
{
"模块管理"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-7b68f372c5e1489fa451ea520fef7d12"
,
"title"
:
"模块管理"
}
},
{
"使用mvnw"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-bc7e72cfd9794593a8043aea050cb8ec"
,
"title"
:
"使用mvnw"
}
},
{
"发布Artifact"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-333c0931793049eabb069ae08e5c92d9"
,
"title"
:
"发布Artifact"
}
}
],
"export"
:
[
"MavenDesc.json"
,
"MavenScript.json"
],
"title"
:
"Maven基础"
}
\ No newline at end of file
data/2.Java中阶/11.并发/1.并发的定义/Abstract.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"Abstract.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/1.并发的定义/Abstract.md
0 → 100644
浏览文件 @
8f066970
# 并发的定义
下列关于并发和并行的说法正确的是:
## 答案
```
并发的多个任务轮流使用CPU
```
## 选项
### A
```
并发是指同一时刻多个任务同时执行
```
### B
```
并行是指同一时间段多个任务同时执行
```
### C
```
单处理器不存在并行
```
data/2.Java中阶/11.并发/1.并发的定义/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-66090dfe673e48a5a14c6ee846c4fc97"
,
"keywords"
:
[],
"children"
:
[
{
"更快的执行"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-4f4e7e1bf6714da0a24705e5cb433e71"
,
"title"
:
"更快的执行"
}
},
{
"改进代码设计"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"改进代码设计"
}
}
],
"export"
:
[
"Abstract.json"
],
"title"
:
"并发的定义"
}
\ No newline at end of file
data/2.Java中阶/11.并发/2.线程属性/Thread.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"Thread.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/2.线程属性/Thread.md
0 → 100644
浏览文件 @
8f066970
# 多线程
下列关于线程的说法错误的是:
## 答案
```
t.join()方法会使其他线程等待t线程执行完毕后才会被唤醒
```
## 选项
### A
```
thread.setDaemon(true)
可以用来设置守护线程
```
### B
```
start()方法可以用来启动一个线程
```
### C
```
线程可以共享资源,因此要注意线程安全问题
```
data/2.Java中阶/11.并发/2.线程属性/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-785476f0c71e437cadeb502a74dd86ed"
,
"keywords"
:
[],
"children"
:
[
{
"中断线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-689a856b2abb4cbb93fe6252c2eab816"
,
"title"
:
"中断线程"
}
},
{
"守护线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"守护线程"
}
},
{
"线程名"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"线程名"
}
},
{
"未捕获异常的处理器"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
}
],
"export"
:
[
"Thread.json"
],
"title"
:
"线程属性"
}
\ No newline at end of file
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"ThreadStatus.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/3.线程状态/ThreadStatus.md
0 → 100644
浏览文件 @
8f066970
# 线程状态
下列关于线程状态的说法错误的是:
## 答案
```
当前线程调用sleep(),进入超时等待状态,并释放对象锁
```
## 选项
### A
```
java线程的状态有5种:新建状态、就绪状态、运行状态、阻塞状态、死亡状态
```
### B
```
当前线程调用wait(),释放对象锁,进入等待队列
```
### C
```
当前线程调用yield(),由运行状态变成就绪状态
```
data/2.Java中阶/11.并发/3.线程状态/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-7a4a0e08d7424b5896f2325f732bdeee"
,
"keywords"
:
[],
"children"
:
[
{
"新建线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-f1fece37484743eeab27863607dd9fde"
,
"title"
:
"新建线程"
}
},
{
"可运行线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"可运行线程"
}
},
{
"阻塞和等待线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"阻塞和等待线程"
}
},
{
"终止线程"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
}
],
"export"
:
[
"ThreadStatus.json"
],
"title"
:
"线程状态"
}
\ No newline at end of file
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"ProductorAndConsumer.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/4.线程之间的协作/ProductorAndConsumer.md
0 → 100644
浏览文件 @
8f066970
# 生产者消费者
生产者消费者是软件开发者经常会用到的一种模式,以下代码是一种简单的实现:
```
java
class
Producter
extends
Thread
{
private
BlockingQueue
<
String
>
queue
;
private
String
name
;
public
Producter
(
String
name
,
BlockingQueue
<
String
>
queue
)
{
this
.
name
=
name
;
this
.
queue
=
queue
;
}
@Override
public
void
run
()
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
queue
.
add
(
name
+
i
);
try
{
Thread
.
sleep
(
2000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
}
class
Consumer
extends
Thread
{
private
BlockingQueue
<
String
>
queue
;
public
Consumer
(
BlockingQueue
<
String
>
queue
)
{
this
.
queue
=
queue
;
}
@Override
public
void
run
()
{
while
(
true
)
{
if
(
queue
.
size
()
>
0
)
{
String
task
=
queue
.
poll
();
System
.
out
.
println
(
task
);
}
}
}
}
public
class
ThreadTest
{
public
static
void
main
(
String
[]
args
)
{
BlockingQueue
<
String
>
queue
=
new
LinkedBlockingQueue
<
String
>(
20
);
// 1
}
}
```
要输出的结果为
```
b0
b1
b2
a0
a1
a2
```
则1处的代码可以是下列选项中的哪一个?
## 答案
```
new Producter("b", queue).start();
try {
Thread.sleep(7000);
} catch (InterruptedException e) {
e.printStackTrace();
}
new Producter("a", queue).start();
new Consumer(queue).start();
```
## 选项
### A
```
new Producter("b", queue).start();
new Producter("a", queue).start();
new Consumer(queue).start();
```
### B
```
new Producter("b", queue).start();
new Consumer(queue).start();
new Producter("a", queue).start();
```
### C
```
new Producter("b", queue).start();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
new Producter("a", queue).start();
new Consumer(queue).start();
```
data/2.Java中阶/11.并发/4.线程之间的协作/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-5e82993df31e4989ac4b128c08cf0823"
,
"keywords"
:
[],
"children"
:
[
{
"wait()与notifyAll()"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-5c28af969c6b4771825c907aac1480b0"
,
"title"
:
"wait()与notifyAll()"
}
},
{
"notify()与notifyAll()"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"notify()与notifyAll()"
}
},
{
"生产者与消费者"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"生产者与消费者"
}
},
{
"任务间使用管道进行输入输出"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
}
],
"export"
:
[
"ProductorAndConsumer.json"
],
"title"
:
"线程之间的协作"
}
\ No newline at end of file
data/2.Java中阶/11.并发/5.死锁/DeadLock.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"DeakLock.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/5.死锁/DeadLock.md
0 → 100644
浏览文件 @
8f066970
# DeadLock
两个线程分别运行以下代码的eatDrink和drinkEat, 会不会发生死锁:
```
java
public
class
DeadLock
{
private
final
String
eat
=
"吃饭"
;
private
final
String
drink
=
"喝水"
;
public
void
eatDrink
()
{
synchronized
(
eat
)
{
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
synchronized
(
drink
)
{
// doSomething
}
}
}
public
void
drinkEat
()
{
synchronized
(
drink
)
{
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
synchronized
(
eat
)
{
// doSomething
}
}
}
}
```
## 答案
```
会
```
## 选项
### A
```
不会
```
data/2.Java中阶/11.并发/5.死锁/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-372114d043a04070ad690f2753b5083b"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[
"DeakLock.json"
],
"title"
:
"死锁"
}
\ No newline at end of file
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"ThreadSafe.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/11.并发/6.线程安全的集合/ThreadSafe.md
0 → 100644
浏览文件 @
8f066970
# 集合线程安全
下列关于集合的线程安全说法错误的是:
## 答案
```
单线程里面使用hashmap同样需要加锁
```
## 选项
### A
```
Collections针对每种集合提供了一种线程安全的包装类
```
### B
```
java.util.concurrent包中的集合也是线程安全的
```
### C
```
java.util.concurrent包优化了加锁的位置,粒度更细,避免锁住整个对象
```
data/2.Java中阶/11.并发/6.线程安全的集合/config.json
0 → 100644
浏览文件 @
8f066970
{
"node_id"
:
"java-aa0b95d8960b4d12a2c9d9e90894a793"
,
"keywords"
:
[],
"children"
:
[
{
"阻塞队列"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-cc7d9f6eee604e51ad6efead3710b3ab"
,
"title"
:
"阻塞队列"
}
},
{
"映射条目的原子更新"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"映射条目的原子更新"
}
},
{
"对并发散列映射的批操作"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"对并发散列映射的批操作"
}
},
{
"并发集视图"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
},
{
"写数组的拷贝"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
},
{
"并行数组算法"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
},
{
"较早的线程安全集合"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
}
}
],
"export"
:
[
"ThreadSafe.json"
],
"title"
:
"线程安全的集合"
}
\ No newline at end of file
data/2.Java中阶/12.Maven基础/MavenDesc.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"MavenDesc.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/12.Maven基础/MavenDesc.md
0 → 100644
浏览文件 @
8f066970
# Maven
以下关于
`Maven`
的说法正确的是:
## 答案
```
以上说法均正确
```
## 选项
### A
```
maven是一个项目管理工具
```
### B
```
maven可以管理项目中的依赖
```
### C
```
maven项目中的pom.xml文件是项目的配置文件
```
data/2.Java中阶/12.Maven基础/MavenScript.json
0 → 100644
浏览文件 @
8f066970
{
"type"
:
"code_options"
,
"author"
:
"clong"
,
"source"
:
"MavenScript.md"
,
"exercise_id"
:
""
,
"notebook_enable"
:
true
}
\ No newline at end of file
data/2.Java中阶/12.Maven基础/MavenScript.md
0 → 100644
浏览文件 @
8f066970
# Maven
以下关于
`Maven`
命令的说法不正确的是:
## 答案
```
mvn test package 运行测试,并打包发布到仓库
```
## 选项
### A
```
mvn compile用于编译源代码
```
### B
```
mvn install 安装项目到本地仓库
```
### C
```
mvn archetype:generate 生成maven项目
```
data/2.Java中阶/9.注解/config.json
浏览文件 @
8f066970
{
"node_id"
:
"java-baada6303aca42f0b2f7882a3446fdf9"
,
"keywords"
:
[],
"children"
:
[
{
"压缩文件"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"java-67a3780782984dea9eb79248c0fae05c"
,
"title"
:
"压缩文件"
}
},
{
"解压缩ZIP文件"
:
{
"keywords"
:
[],
"children"
:
[],
"node_id"
:
"569d5e11c4fc5de7844053d9a733c5e8"
,
"title"
:
"解压缩ZIP文件"
}
}
],
"children"
:
[],
"export"
:
[],
"title"
:
"注解"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录