【问题标题】:Why does this constructor of a custom class have 'super' in its brackets?为什么自定义类的这个构造函数的括号中有“super”?
【发布时间】:2017-05-22 22:20:24
【问题描述】:
public WordAdapter(Context context, ArrayList<Word> words)


    {
        super(context, 0, words);
    }

这里的括号里为什么会出现super?

【问题讨论】:

标签: java android


【解决方案1】:

因为它正在调用超类中的特定构造函数。以Context, int, ArrayList&lt;Word&gt; 作为参数的一种。如果没有明确的superthis 作为第一行(any 构造函数),那么对super()隐式 空调用是添加了

【讨论】:

    猜你喜欢
    • 2015-06-08
    • 2015-10-03
    • 2012-02-10
    • 1970-01-01
    • 2017-09-04
    • 1970-01-01
    • 2021-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多