3、(1) 创建一个类 Person,属性有姓名(name, 无修饰符,字符串类型),年龄(age, private 修饰)。 第2页共5页 (2)分别通过 public 修饰的方法 getAge(...

答:根据您的要求,以下是Person类和Test3类的实现:Person类: public class Person { String name; private int age;

public Person(){
    super();
}

public Person(String name){
    this.name = name;
}

public Person(String name, int age){
    this.name = name;
    th

猜你喜欢

转载自blog.csdn.net/weixin_35751194/article/details/129524392