第十次上机

public class Student {
    private String name ;
    private double achv;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public double getAchv() {
        return achv;
    }
    public void setAchv(double achv) {
        this.achv = achv;
    }
    Student(){
        
    }
    Student(String name,double achv){
        this.achv=achv;
        this.name=name;
    }
    
}
public class Person {
    public Person() {
        System.out.println("无参的构造方法被调用了...");
    }
}


package fff;

public class fff {

    public static void main(String[] args) {
        Person p1 = new Person();
    }

}
public class fff {
    private String name;
    private String color;
    public void run(){
        System.out.println("车跑的很快");
    }
    public Car() {
    }

    public Car(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}

 

posted @ 2020-05-07 11:47  啪啪怪  阅读(122)  评论(0编辑  收藏  举报