An abstract class in Java need not implement any methods from its implementing interface. Why?

前端 未结 5 1096
星月不相逢
星月不相逢 2021-02-04 14:08

Let\'s look at the following simple code snippet in Java.

interface Sum
{
    abstract public void showSum();
}

interface Mul
{
    abstract public void showMul         


        
5条回答
  •  猫巷女王i
    2021-02-04 14:33

    This ought to be comment to JB Nizet's answer, but I cant post comments yet :( Note that you could provide the implementation for the showSum() method in your abstract class, and still have that class remain abstract without any problems. An abstract class could have all methods implemented and still be abstract!

提交回复
热议问题