Java Object-Oriented Programming Exam Questions and Answers, Exams of Java Programming

Java OOP Q&A covering inheritance, polymorphism, encapsulation, and abstraction. Questions test access modifiers, class structures, method overriding, interfaces, and abstract classes. A study aid for Java and OOP principles, offering a concise review of key concepts and terminology. Useful for exam preparation and reinforcing OOP paradigms. A valuable resource for students and developers solidifying Java OOP knowledge. Quick reference to essential terms and principles, aiding learning and application. Structured as Q&A for easy review and testing, useful for exam prep or knowledge reinforcement.

Typology: Exams

2024/2025

Available from 06/26/2025

brian-mwihia
brian-mwihia 🇺🇸

1.2K documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf3
pf4

Partial preview of the text

Download Java Object-Oriented Programming Exam Questions and Answers and more Exams Java Programming in PDF only on Docsity!

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

The ______ method compares the data in objects - .equals() The Object class provides three important methods to all of its children: _____, _____, and _____ - .equals(), .toString(), .hashCode() Taking an object reference and treating it as a reference to its base type is called _____ - upcasting _____ refers to a programming language's ability to process objects differently depending on their data type or class - polymorphism A _____ is a blueprint for an object. - class A single instantiated realization of a Class is called _______ - An object or instance ______ and ______ are defined in classes - methods and fields What are the four main principles of Object-Oriented Programming? - encapsulation, abstraction, inheritance, and polymorphism ______ and ______ can be defined to accept parameters - Constructors and methods Applying ____ means that each object should only expose a high-level mechanism for using it. - abstraction ______ is when a class has two methods with the same name but different parameter lists - Overloading ______ methods do not require an instance of a class to be invoked - static

Can a class extend multiple classes? - no a class can only extend 1 other class An ______ does not have a body - abstract method An abstract method only has a ______ - method signature ______ cannot be instantiated - interfaces and abstract classes Interfaces can be ______ by classes or abstract classes - implemented Interfaces can be ______ by other interfaces - extended The keyword used to inherit an Interface is... - implements The keyword used to inherit a class or abstract class is ________ - extends ______ is when a subclass redefines a method of it's parent class - Overriding ______ are not inherited - private and static members