标题: 07,虽然我不懂,但是我就是要发出来,毕竟敲了半天 [打印本页] 作者: emmm... 时间: 2017-12-7 21:41 标题: 07,虽然我不懂,但是我就是要发出来,毕竟敲了半天 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() {
}
}
作者: 渝小妹 时间: 2017-12-8 08:54
good good study day day up作者: 花开的季节 时间: 2017-12-8 09:49
加油,加油,加油!作者: 1414225997 时间: 2017-12-8 10:40
虽然我也不懂但是能敲出来还是说明你掌握了,继续努力作者: emmm... 时间: 2017-12-8 17:30