When we use the super keyword in the constructor, do we need to import the class referenced by super (when super does not refer to Object)?
class A extends ... { A() { super(); // do we need to import the class super refers to? } }
Yes, because he is in the offer extends.
extends
Itself super()does not require import, but in order to make sense, you need a superclass. You do not need to import it, of course, if it is fromjava.lang
super()
java.lang
You need to import the superclass if it is not in the same package or is in java.lang. If the base class is unavailable, it super()doesn't work anyway.
Source: https://habr.com/ru/post/1785595/More articles:Регулярное выражение Python для выделения тегов script - pythonPHP: Can range () be used for fractions? - decimalКак захватить исходный ввод мыши в X11? - inputHow to create a poem in English - nlpAndroid daemon - androidThe difference between sphinx thinking indexation methods - ruby-on-railsuid in url, is it google friendly? - urlSQL LIKE statement does not work with Asian languages (SQL Server 2008) - sql-serverIs it possible to create a Python list and fake it? - pythonWhat could cause the return function to fail? C ++ - c ++All Articles