Problem overriding ArrayList add method

前端 未结 7 1751
一整个雨季
一整个雨季 2021-01-27 19:45

I have a class that is extending Java\'s ArrayList. I\'m currently using Java build 1.6.0_22-b04. Looks like this:

public class TokenSequence extends ArrayList&         


        
相关标签:
7条回答
  • 2021-01-27 20:44

    Absolutely - use the @Override annotation, and ideally use the strongly typed signature:

    @Override
    public void add(Token token) {
        ...
    }
    
    0 讨论(0)
提交回复
热议问题