您现在的位置是:网站首页> Android

JAVA学习

  • Android
  • 2021-08-29
  • 739人已阅读
摘要

基类继承

public abstract class Person

{

private String name;

 public Person(String n)

{

name=n;

}

public abstract String getDes();

public String getName()

{

return name;

}


}


class Student extends Person

{

 public Student(String n,String m)

{

super(n);

major=m;

}

public String getDec()

{

return  major;

}

private String major;

}


接口

public interface  Flayable{

public final int wiNumber;

public abstract void Fly();

}


public class Bat implements Fly

{

@override

public void Fly()

{

}

}

Top