public static void main(String[] args) {
LY a=new LY();
a.name= "马叉虫";
a.age= 18;
a.gender="啥";
a.sleep();
a.study();
a.speak();
System.out.println("-------------");
BJ a1=new BJ();
a1.name="马叉虫男";
a1.age=19;
a1.gender="啥子";
a1.sleep();
a1.study();
a1.speak(); }
}
class P{String name ;int age;String gender;
public P() {
}
public P(String name, int age, String gender) {
super();
this.name = name;
this.age = age;
this.gender = gender;
}
public void eat(){
System.out.println("吃饭");
}
public void sleep(){
System.out.println("睡觉");
}
}
interface English{
public abstract void speak();
}
abstract class Play extends P{
public abstract void study();
}
abstract class coach extends P{
public abstract void teach();
}
class LY extends Play implements English{
public void study() {
System.out.println("学扣篮");
}
public void speak() {
System.out.println("说英语");
}
}
class BBY extends Play{
public void study() {
System.out.println("学习抽球");
}
}
class LJ extends Play implements English{
public void study() {
System.out.println("教扣篮");
}
public void speak() {
System.out.println("说英语 ");
}
}
class BJ extends Play {
public void study() {
System.out.println("教扣球");
}
public void speak() {
}
}
|
|