Java OOP Concepts Flashcards

1
Q

In Java, a ___ is a blueprint for creating objects.

An ___ is an instance of a class and has its own state and behavior.

A

class and objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A ___ in Java is a block of code that performs a specific task.

___ are used to divide a program into smaller and more manageable pieces.

A

method/s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A ___ in Java is a special method that is used to create an object.

____s have the same name as the class and are called when an object is created.

A

constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A ___ in Java is a sequence of characters.

____ are used to represent text in a program and provide a wide range of methods for manipulating and comparing them.

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

____ are keywords in Java that determine the accessibility of classes, methods,
and variables in a Java program. There are four types of access modifiers: public, protected, private, and default.

A

access modifiers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In Java, ___ is a keyword that refers to the current object instance. It is used to refer to the current object’s members, methods, and constructors.

A

“this” keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Java, ___ is a keyword that can be used to declare a variable, method, or class as
unchangeable or immutable. Once a variable is declared final, its value cannot be changed, and
if a method is declared final, it cannot be overridden by a subclass.

A

“final” keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Java ___ is a programming technique where a method calls itself to solve a problem. It is a common technique used in solving problems that can be broken down into smaller subproblems.

A

recursion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Java ___ is a mechanism in which one class acquires the properties (fields and methods) of another class. The class that is inherited is called the superclass, and the class that inherits is called the subclass.

A

inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Java ___ is a mechanism in which a subclass provides its own implementation of
a method that is already defined in its superclass. The method in the subclass must have the same name, return type, and parameter list as the method in the superclass.

A

Method Overriding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Java ___ is a mechanism in which a class can have multiple methods with the same name but different parameter lists. The method that is called depends on the number and type of arguments passed to it.

A

Method Overloading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In Java, ___ is a keyword that refers to the superclass of a subclass. It is used to call the
superclass constructor, access the superclass’s fields and methods, and prevent method overriding.

A

“super” keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Java ___ is a class that cannot be instantiated, and it is used to provide a base or framework for subclasses. An abstract method is a method that has no implementation in the abstract class, and it must be implemented in the subclass.

A

Abstract class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Java ___ are a collection of abstract methods that can be implemented by a class. They are used to define a contract between the implementing class and the rest of the program.

A

java interfaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Java ___ is a concept in which a single object can take on different forms or types. It can be achieved through method overloading, method overriding, and inheritance.

A

polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Java is a mechanism in which the fields of a class are made private to prevent direct access from outside the class. The fields can only be accessed through getter and setter methods. This helps to ensure data integrity and security.

A

encapsulation