Tag: programming languages
Questions Related to programming languages
-
Compile fail due to error on line no 2
-
Compile fail due to error on line no 9
-
Compile fail due to error on line no 8
-
15
-
8 7
-
10 7
-
Compilation fails with an error at line 3
-
Compilation fails with an error at line 5
-
The keyword extends is used to specify that an interface inherits from another interface.
-
The keyword extends is used to specify that a class inherits from an interface.
-
The keyword implements is used to specify that an interface inherits from another interface.
-
The keyword implements is used to specify that a class inherits from an interface.
-
The keyword implements is used to specify that a class inherits from another class.
-
public
-
static
-
void
-
main
-
String
-
Less restrictive than public
-
More restrictive than public, but less restrictive than protected.
-
More restrictive than protected, but less restrictive than private.
-
More restrictive than private.
-
Less restrictive than protected from within a package, and more restrictive than protected from outside a package.
-
static public void main(String[] args) { /* ... */ }
-
public static int main(String[] args) { /* ... */ }
-
public static void main(String args) { /* ... */ }
-
public int main(Strings[] args, int argc) { /* ... */ }
-
from base to the derived class
-
from derived to base
-
only the derived class
-
only the base class
-
A subclass must define all the methods from the superclass
-
It is possible for a subclass to define a method with the same name and parameters as a method defined by the superclass.
-
It is possible for a subclass to define a field with the same name as a field defined by the superclass.
-
It is possible for two classes to be the superclass of each other.
-
The class will fail to compile, since the class Other has not yet been declared when referenced in class AClass.
-
The class will fail to compile, since import statements must never be at the very top of a file.
-
The class will fail to compile, since the package declaration can never occur after an import statement.
-
The class will fail to compile, since the class Other must be defined in a file called Other.java.
-
The class will fail to compile, since the class Other must be declared public.