day06-面向对象-封装的优化_this的使用

This commit is contained in:
2026-01-19 11:25:48 +08:00
parent f1c23824f8
commit a1960a6a27
2 changed files with 23 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ public class Demo04 {
public static void main(String[] args) {
//创建一个学生,并给学生设置属性值,展示该学生
Student s = new Student();
System.out.println("s的地址"+s);//s中保存的是地址
//设置属性
//s.name = "张三";
s.setName("张三");