Docsity

JAVA: OBJECT-ORIENTED PROGRAMMING QUESTIONS AND ANSWERS VERIFIED GRADED A+, Exams of Software Development

Toggle sidebar
bg1
JAVA: OBJECT-ORIENTED
PROGRAMMING QUESTIONS AND
ANSWERS VERIFIED GRADED A+
ALREADY PASSED|2025|2026
A single instantiated realization of a Class is called _______ - CORRECT
ANSWER-An object or instance
______ and ______ are defined in classes - CORRECT ANSWER-methods
and fields
What are the four main principles of Object-Oriented Programming? -
CORRECT ANSWER-encapsulation, abstraction, inheritance, and
polymorphism
______ and ______ can be defined to accept parameters - CORRECT
ANSWER-Constructors and methods
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download JAVA: OBJECT-ORIENTED PROGRAMMING QUESTIONS AND ANSWERS VERIFIED GRADED A+ and more Exams Software Development in PDF only on Docsity!

JAVA: OBJECT-ORIENTED

PROGRAMMING QUESTIONS AND

ANSWERS VERIFIED GRADED A+

ALREADY PASSED|2025|

A single instantiated realization of a Class is called _______ - CORRECT ANSWER-An object or instance ______ and ______ are defined in classes - CORRECT ANSWER-methods and fields What are the four main principles of Object-Oriented Programming? - CORRECT ANSWER-encapsulation, abstraction, inheritance, and polymorphism ______ and ______ can be defined to accept parameters - CORRECT ANSWER-Constructors and methods

Applying ____ means that each object should only expose a high-level mechanism for using it. - CORRECT ANSWER-abstraction ______ is when a class has two methods with the same name but different parameter lists - CORRECT ANSWER-Overloading ______ methods do not require an instance of a class to be invoked - CORRECT ANSWER-static Static methods can only interact with ______ - CORRECT ANSWER-static fields and methods 'Fields' are ______ that are attached to an instance of a class. - CORRECT ANSWER-variables

A variable representing an object contains a _____ - CORRECT ANSWER- Memory Address If a variable does not contain a reference to a memory address or a value, then that variable is ____ - CORRECT ANSWER-null If you do not define a constructor, your class will have a ______ - CORRECT ANSWER-default constructor The equality operator ( == ) compares the equality of values, even if those values are ______ - CORRECT ANSWER-memory addresses _____ happens when we define a variable in a closure scope with a variable name that is the same as one for a variable we've already defined in an outer scope. - CORRECT ANSWER-Variable shadowing

How do you test strings for equality? - CORRECT ANSWER-.equals() Inheritance is a mechanism in which one class can inherit the ______ of another "parent" class - CORRECT ANSWER-fields and methods In Java, a class can ______ up to one other class to inherit from it - CORRECT ANSWER-extend Can a class extend multiple classes? - CORRECT ANSWER-no a class can only extend 1 other class An ______ does not have a body - CORRECT ANSWER-abstract method An abstract method only has a ______ - CORRECT ANSWER-method signature

______ are not inherited - CORRECT ANSWER-private and static members To call the constructor of a parent class, you must use the ______ keyword - CORRECT ANSWER-super The default access modifier is ______ - CORRECT ANSWER-package- private A package-private member of a class is visible to ______ - CORRECT ANSWER-members of the same package A public member of a class is visible to ______ - CORRECT ANSWER- everything

A private member of a class is visible to ______ - CORRECT ANSWER- only the defining class A protected member of a class is visible to ______ - CORRECT ANSWER- subclasses and members of the same package private members and static methods cannot be ______ - CORRECT ANSWER-overridden The ______ operator can be used to check if an object is of a specific type or is a subtype of that type. - CORRECT ANSWER-instanceof In Java, all classes inherit from the ______ class by default - CORRECT ANSWER-Object In Java 8, an interface can contain method bodies if it uses the ______ keyword - CORRECT ANSWER-default