Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么自定义类的此构造函数具有';超级';在括号内? publicWordAdapter(上下文、ArrayList单词) { 超级(上下文,0,单词); }_Java_Android - Fatal编程技术网

Java 为什么自定义类的此构造函数具有';超级';在括号内? publicWordAdapter(上下文、ArrayList单词) { 超级(上下文,0,单词); }

Java 为什么自定义类的此构造函数具有';超级';在括号内? publicWordAdapter(上下文、ArrayList单词) { 超级(上下文,0,单词); },java,android,Java,Android,为什么super会出现在这里的括号中?因为它正在调用super类中的特定构造函数。以上下文、int、ArrayList为参数的函数。如果没有明确的super或this作为(任何构造函数的的第一行,则添加了对super()的隐式空调用可能重复的 public WordAdapter(Context context, ArrayList<Word> words) { super(context, 0, words); }

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

因为它正在调用super类中的特定构造函数。以
上下文、int、ArrayList
为参数的函数。如果没有明确的
super
this
作为(任何构造函数的的第一行,则添加了对
super()
的隐式空调用

可能重复的
public WordAdapter(Context context, ArrayList<Word> words)


    {
        super(context, 0, words);
    }