12345678910111213141516171819 |
- package J20250714.demo01;
- /**
- * @author WanJl
- * @version 1.0
- * @title TestPerson
- * @description
- * @create 2025/7/14
- */
- public class TestPerson {
- public static void main(String[] args) {
- Person p=new Person();
- p.name="张三";
- //p.age=256; //赋值是符合Java要求的。但是跟我们的业务是不符的
- p.setAge(56);
- int a=p.getAge();
- System.out.println(a);
- }
- }
|