2019-06-13
How to make a abstract class with default comments on it?
源自: stackoverflow
问题

I have a superclass with an abstract method I want to provide some comments on the method and if any subclasses inherited this method this comments will come along with it.

class MySuper {

    //some comments
    protected abstract void myAbstractMethod();
}

class MyChild extends MySuper {

    //some comments
    @Override
    public void updateLanguage() {

    }
}
答案
1

You need to add proper java-doc comments, than that implementing class will get those.

This technique is used in various places inside the jdk too - methods are inherited only to get their documentation.

How to make a abstract class with default comments on it?
查看原网页