Inheritance/polymorphism

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

An abstract class declares one or more __________ methods.

ABSTRACT

A class is a ______________ or prototype from which objects are created. It includes components like Modifiers, class keyword, class name, Superclass, Interfaces, and Body.

BLUEPRINT

To copy the values of one object into another in Java using a constructor, you can do so __________________.

BY CONSTRUCTOR

A constructor must have the same name as its ________.

CLASS

Objects are created from ______ in Java or any other languages.

CLASS

Objects are instances of _________

CLASSES

The ________ method creates and returns a copy of the object in Java.

CLONE()

Polymorphism is of two different types, i.e., __________ and runtime polymorphism.

COMPILE-TIME

In Java, objects are initialized using _____________.

CONSTRUCTOR

When creating an object using the clone() method, it creates and returns a ________ of the object.

COPY

Object-oriented programming is also called the _____ of Java.

CORE

If there is no constructor in a class, the compiler automatically creates a ______________ constructor.

DEFAULT

The type of constructor that doesn't have any parameters is called a __________ constructor.

DEFAULT

The type of constructor that is automatically created by the compiler when no constructor is defined in a class is the ____________ constructor.

DEFAULT

Constructor overloading in Java is a technique to create multiple constructors with _____________ parameter lists.

DIFFERENT

In Java, the keyword used to indicate inheritance from a superclass to a subclass is _________

EXTENDS

Inheritance supports hierarchical classification, creating new classes based on existing classes through the use of the ________keyword.

EXTENDS

Abstraction aims to display all available information.

FALSE

An abstract class can be instantiated directly.

FALSE

Compile-time polymorphism is also called dynamic method dispatch.

FALSE

Inheritance can be achieved in Java using the "inherit" keyword.

FALSE

Naming conventions for variables in Java recommend starting with an uppercase letter.

FALSE

Objects in Java correspond to primitive data types.

FALSE

Polymorphism refers to performing a single action in only one way.

FALSE

To create an object using the Class.forName(String className) method, provide the ______________ name for the class and call newInstance() on the returned Class object.

FULLY QUALIFIED

An object in Java consists of three main components: State, Behavior, and _____________.

IDENTITY

The constructor is invoked explicitly, and the method is invoked ____________.

IMPLICITLY

The four main principles of Object-Oriented Programming are abstraction, encapsulation, _________, and polymorphism.

INHERITANCE

In the context of inheritance, a superclass is the class being _________ from.

INHERITED

In the context of Java inheritance, a subclass is the class that _________ from another class.

INHERITS

The primary purpose of a Java constructor is to ________ the object's state.

INITIALIZE

A parameterized constructor in Java is used for ______________ the state of an object.

INITIALIZING

When an object of a class is created, the class is said to be _______________.

INSTANTIATED

A class in Java can implement more than one _________.

INTERFACE

The most common way to create objects in Java is to use the ______keyword, like this: ClassName objectName = new ClassName();

NEW

In Java, there is ______ a copy constructor.

NO

All classes have at least one constructor. If a class doesn't declare any, the Java compiler provides a ____________ constructor.

NO-ARGUMENT

The Object class is the parent of all classes either directly or indirectly, and it contains a default constructor that calls the class parent's __________ constructor.

NO-ARGUMENT

Inheritance represents the __________-child relationship.

PARENT

Encapsulation is achieved by declaring variables as __________ and providing public getter and setter methods.

PRIVATE

The new operator creates a new object, allocates memory, and returns a ____________ to that memory.

REFERENCE

In Java, a constructor has the same name as the class and no ____________ type.

RETURN

A key difference between constructors and methods in Java is that constructors have no return type, while methods may have a _____________.

RETURN TYPE

A constructor is used to initialize new objects. Fields are variables that provide the __________ of the class and its objects, and methods implement class behavior.

STATE

Encapsulation prevents code and data from being accessed by outsiders.

TRUE

Inheritance can create a parent-child relationship between classes.

TRUE

Inheritance supports single, multilevel, multiple, hybrid, and hierarchical types.

TRUE

To declare a reference variable in Java without creating an object, you can use the syntax: ClassType variableName; For example, Dog tuffy; declares a reference variable, but it remains ________________ until an object is assigned to it.

UNDETERMINED

Abstraction is a process that displays only the information needed and hides the ____________ information.

UNNECESSARY

What are the two main categories involved in the "inheritance concept" in Java? a. ____________ (child) b. ______________ (parent)

a. SUBCLASS , b. SUPERCLASS


Ensembles d'études connexes

NURS 2211: Female Reproductive Problems

View Set

Globalization and Politics Midterm Review

View Set

Brown vs. Board of Education and Desegregation

View Set

Joint Mobs midterm review questions

View Set

BJU Grade Nine, Cultural Geography, Chapter 22 test

View Set