Skip to content

Commit e542bf9

Browse files
committed
修改
1 parent 229af16 commit e542bf9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adapter/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,6 @@ public class BusAdapter implements Car {
8181
>* 类适配器的适配功能是通过被适配类(接口)的一个对象间接完成的。因此,类适配器不能无法
8282
对被适配类的所有子类进行适配
8383
>* 类适配器重写了被适配类(接口)的方法,所以,类适配器可以看做被适配类(接口)的一个子类
84-
>* 类适配器一般只需持有一个被适配类(接口)的对象,并不需要额外的对被适配类(接口)的引用
84+
>* 类适配器一般只需持有一个被适配类(接口)的对象,并不需要额外的对被适配类(接口)的引用
85+
>* 对象适配器可以和多个被适配类(接口)的对象协同工作——即被适配类(接口)本身及其所有子类。适配器也可以一次为所有的被适配类(接口)添加自定义的功能。
86+
>* 对象适配器使得重写被适配类(接口)的方法变成了不可能,这时需要的是被适配类(接口)的子类,而不是被适配类(接口)本身。

0 commit comments

Comments
 (0)