Java“南通青鳥 IT 教育 96 班同學在 3 教室上陸老師的 Java 課”

金凝橡炙發表於2017-10-31
package study;

public class Sys {
    //構造方法
    public Sys(String school, String className, String address,String teacher, String curriculum) {
        this.school = school;
        this.address = address;
        this.className = className;
        this.teacher = teacher;
        this.curriculum = curriculum;
    }

    //物件屬性
    String address;
    String className;
    String school;
    String teacher;
    String curriculum;

    //物件方法
    String studying() {
        return this.school+this.className+"在"+this.address+"上"+this.teacher+"的"+this.curriculum+"課";
    }
}
package study;

public class Study {
    public static void main(String[] args) {
        Sys doing = new Sys("南通青鳥IT教育", "96班同學", "3教室", "陸老師","Java");
        System.out.println(doing.studying());
    }
}

南通青鳥IT教育96班同學在3教室上陸老師的Java課

相關文章