Java: Object-Oriented Programming UPDATED ACTUAL Exam
Questions and CORRECT Answers
To call the constructor of a parent class, you must use the ______ keyword - super
The default access modifier is ______ - package-private
A package-private member of a class is visible to ______ - members of the same package
A public member of a class is visible to ______ - everything
A private member of a class is visible to ______ - only the defining class
A protected member of a class is visible to ______ - subclasses and members of the same
package
private members and static methods cannot be ______ - overridden
The ______ operator can be used to check if an object is of a specific type or is a subtype of that
type. - instanceof
In Java, all classes inherit from the ______ class by default - Object
In Java 8, an interface can contain method bodies if it uses the ______ keyword - default
public & private are examples of _________ - access modifiers
Questions and CORRECT Answers
To call the constructor of a parent class, you must use the ______ keyword - super
The default access modifier is ______ - package-private
A package-private member of a class is visible to ______ - members of the same package
A public member of a class is visible to ______ - everything
A private member of a class is visible to ______ - only the defining class
A protected member of a class is visible to ______ - subclasses and members of the same
package
private members and static methods cannot be ______ - overridden
The ______ operator can be used to check if an object is of a specific type or is a subtype of that
type. - instanceof
In Java, all classes inherit from the ______ class by default - Object
In Java 8, an interface can contain method bodies if it uses the ______ keyword - default
public & private are examples of _________ - access modifiers