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课