Can't declare an abstract method private

前端 未结 6 1606
再見小時候
再見小時候 2020-12-11 00:31

I want to do this, yet I can\'t. Here is my scenario and rational. I have an abstract class for test cases that has an abstract method called test(). The test() method is to

6条回答
  •  误落风尘
    2020-12-11 00:59

    abstract means you'll want to define the method in a child class

    private means the child classes won't see the method

    How could it compile ?

    If the method should end up public, declare it public abstract, that's all.

提交回复
热议问题