mirror of
https://github.com/LingCoder/OnJava8.git
synced 2026-08-23 22:43:28 +08:00
Update 07-Implementation-Hiding.md
This commit is contained in:
@@ -48,7 +48,7 @@ public class SingleImport {
|
||||
}
|
||||
```
|
||||
|
||||
现在你就可以不加限定词,直接使用 **ArrayList** 了。但是对于 **java.util** 包下的其他类,你还是不能用。要导入其中所有的类,只需使用 ***** ,就像本书中其他示例那样:
|
||||
现在你就可以不加限定词,直接使用 **ArrayList** 了。但是对于 **java.util** 包下的其他类,你还是不能用。要导入其中所有的类,只需使用 **\*** ,就像本书中其他示例那样:
|
||||
```java
|
||||
import java.util.*
|
||||
```
|
||||
@@ -201,7 +201,7 @@ com.mindviewinc.simple.List
|
||||
|
||||
### 冲突
|
||||
|
||||
如果通过 ***** 导入了两个包含相同名字类名的类库,会发生什么?例如,假设程序如下:
|
||||
如果通过 **\*** 导入了两个包含相同名字类名的类库,会发生什么?例如,假设程序如下:
|
||||
|
||||
```java
|
||||
import com.mindviewinc.simple.*;
|
||||
|
||||
Reference in New Issue
Block a user