- 要定义抽象方法 这个类必须是抽象类
public class TestA
{
abstract void fun();
//The abstract method fun in type TestA can only be defined by an abstract class
}
- 继承这个抽象类的类必须实现其中的抽象方法
public class TestB extends TestA
{
//The type TestB must implement the inherited abstract method TestA.fun()
@Override
void fun()
{
}
}
- 抽象方法不能有实现
public abstract class TestA
{
abstract void fun()//Abstract methods do not specify a body
{
}