package com.phome.test1;
public class Student {
String stuName="王海";
int stuNo=001;
String stuGender="男";
public void study(){
System.out.println(stuName+"正在学习。");
}
}
package com.phome.test1;
public class Teacher {
String teaName="张三";
int teaNo=1001;
String teaGender="女";
public void teach(){
System.out.println(teaName+"正在授课。");
}
}
package com.phome.test1;
public class Building {
String buildName="艺术楼";
int buildNo=514;
public void used(){
System.out.println(buildNo+"教室正在被使用。");
}
}
package com.phome.test1;
public class Dog {
String dogName="点点";
String dogColor="黑";
public void eat(){
System.out.println(dogName+"正在找吃的");
}
}
package com.phome.test1;
public class Tree {
String treeType="柏树";
String treeColor="绿";
public void walf(){
System.out.println(treeType+"正在风中摇曳。");
}
}
package com.phome.test1;
public class School {
Student student = new Student();
Teacher teacher = new Teacher();
Building building = new Building();
Dog dog = new Dog();
Tree tree = new Tree();
public String toString() {
System.out.println(student.stuName);
System.out.println(student.stuNo);
System.out.println(student.stuGender);
student.study();
System.out.println(teacher.teaName);
System.out.println(teacher.teaNo);
System.out.println(teacher.teaGender);
teacher.teach();
System.out.println(building.buildName);
System.out.println(building.buildNo);
building.used();
System.out.println(dog.dogName);
System.out.println(dog.dogColor);
dog.eat();
System.out.println(tree.treeType);
System.out.println(tree.treeColor);
tree.walf();
return "";
}
}
package com.phome.test1;
public class SchoolTest {
public static void main(String[] args) {
School school=new School();
System.out.println(school);
}
}