Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1cdc78e
add 算法和数据结构
Sep 5, 2018
8156c42
add
Sep 5, 2018
d38ec3f
Merge pull request #400 from zhaozhengcoder/master
CyC2018 Sep 5, 2018
5fe72c3
Update README.md
CyC2018 Sep 5, 2018
9aebc46
单例模式添加枚举实现
peiel Sep 5, 2018
a015b11
auto commit
CyC2018 Sep 5, 2018
4fa8a6b
Update and rename notes/计算机操作系统.md to notes/计算机操作系统.md
yugandharbandi Sep 5, 2018
4ee1497
Update 计算机操作系统.md
yugandharbandi Sep 5, 2018
59fda4c
Update 计算机操作系统.md
haonanya1 Sep 6, 2018
6e61d32
the difference of new and malloc
Sep 6, 2018
dba7855
Merge pull request #405 from 1980744819/master
CyC2018 Sep 6, 2018
990efe2
Merge pull request #404 from duang123/patch-1
CyC2018 Sep 6, 2018
4ad7755
Merge pull request #401 from peierlong/master
CyC2018 Sep 6, 2018
ed2a71f
Merge pull request #403 from yugandharbandi/master
CyC2018 Sep 6, 2018
1365bc4
auto commit
CyC2018 Sep 6, 2018
cb1f030
Merge branch 'master' of https://github.com/CyC2018/Interview-Notebook
CyC2018 Sep 6, 2018
3c08c15
auto commit
CyC2018 Sep 6, 2018
bd7d42b
修复代码运行报错
peiel Sep 6, 2018
f439ed1
Merge branch 'master' into master
CyC2018 Sep 6, 2018
8674be4
Merge pull request #407 from peierlong/master
CyC2018 Sep 6, 2018
941f8e3
auto commit
CyC2018 Sep 6, 2018
f82b21b
remove submodule
CyC2018 Sep 6, 2018
7324207
auto commit
CyC2018 Sep 7, 2018
187f0bd
auto commit
CyC2018 Sep 7, 2018
24c4864
Update 设计模式.md
peiel Sep 7, 2018
e69d324
Merge pull request #408 from peierlong/patch-5
CyC2018 Sep 7, 2018
0fbafac
auto commit
CyC2018 Sep 7, 2018
0b5be89
fix: fix several typos in 'Java 容器.md'
fractalists Sep 7, 2018
f6e6808
auto commit
CyC2018 Sep 7, 2018
cedbf9f
Merge branch 'master' of https://github.com/CyC2018/InterviewNotes
CyC2018 Sep 7, 2018
22e77f0
Merge pull request #409 from JacobChengZhang/master
CyC2018 Sep 7, 2018
90440d8
auto commit
CyC2018 Sep 8, 2018
8a9b8b1
Merge branch 'master' of https://github.com/CyC2018/Interview-Notebook
CyC2018 Sep 8, 2018
5c5c056
Update Java 基础.md
blueblueblueblueblueblue Sep 10, 2018
59ca4ee
Merge pull request #412 from blueblueblueblueblueblue/patch-1
CyC2018 Sep 10, 2018
e697abd
auto commit
CyC2018 Sep 10, 2018
3c6be1a
auto commit
CyC2018 Sep 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 设计模式.md
枚举代码风格修正
  • Loading branch information
peiel authored Sep 7, 2018
commit 24c4864bfb0e55641c2613b07347c84cf41be77f
10 changes: 5 additions & 5 deletions notes/设计模式.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public class ConcreteHandler1 extends Handler {

@Override
protected void handleRequest(Request request) {
if (request.getType() == RequestType.type1) {
if (request.getType() == RequestType.TYPE1) {
System.out.println(request.getName() + " is handle by ConcreteHandler1");
return;
}
Expand All @@ -676,7 +676,7 @@ public class ConcreteHandler2 extends Handler{

@Override
protected void handleRequest(Request request) {
if (request.getType() == RequestType.type2) {
if (request.getType() == RequestType.TYPE2) {
System.out.println(request.getName() + " is handle by ConcreteHandler2");
return;
}
Expand Down Expand Up @@ -709,7 +709,7 @@ public class Request {

```java
public enum RequestType {
type1, type2
TYPE1, TYPE2
}
```

Expand All @@ -718,9 +718,9 @@ public class Client {
public static void main(String[] args) {
Handler handler1 = new ConcreteHandler1(null);
Handler handler2 = new ConcreteHandler2(handler1);
Request request1 = new Request(RequestType.type1, "request1");
Request request1 = new Request(RequestType.TYPE1, "request1");
handler2.handleRequest(request1);
Request request2 = new Request(RequestType.type2, "request2");
Request request2 = new Request(RequestType.TYPE2, "request2");
handler2.handleRequest(request2);
}
}
Expand Down