| 123456789101112131415161718 |
- package p1;
- /**
- * @author WanJl
- * @version 1.0
- * @title p1.PersonTest
- * @description
- * @create 2026/7/20
- */
- public class PersonTest {
- public static void main(String[] args) {
- Person p=new Person();
- p.name="张三";
- p.setAge(200); //赋值
- int age=p.getAge(); //取值
- System.out.println(age); //把取到的年龄输出
- }
- }
|