1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Merge pull request #2028 from cxrwy/main

Update java-basic-questions-02.md
This commit is contained in:
Guide 2023-05-25 08:36:13 +08:00 committed by GitHub
commit ece7053fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,7 +291,7 @@ Person person1Copy = person1.clone();
System.out.println(person1.getAddress() == person1Copy.getAddress());
```
从输出结构就可以看出,`person1` 的克隆对象和 `person1` 包含的 `Address` 对象已经是不同的了。
从输出结构就可以看出,`person1` 的克隆对象和 `person1` 包含的 `Address` 对象已经是不同的了。
**那什么是引用拷贝呢?** 简单来说,引用拷贝就是两个不同的引用指向同一个对象。