OOP Flashcards

1
Q

Class:

A

Blueprint for creating objects. It defines a data structure that includes data members (fields) and methods.

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

Object:

A

An instance of a class. It represents a real-world entity and has state and behavior.

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

Inheritance:

A

Mechanism where a new class inherits properties and behaviors from an existing class. It promotes code reuse.

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

Polymorphism

A

Ability of a class to take on multiple forms. It allows objects of different classes to be treated as objects of a common base class.

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

Encapsulation

A

Bundling of data (attributes) and methods that operate on the data within a single unit (class). It restricts direct access to some of an object’s components.

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

Abstraction

A

Concept of hiding complex implementation details and showing only the necessary features of an object.

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

Constructor

A

Special method used for initializing objects. It is called when an object is created.

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

Method Overloading

A

Defining multiple methods in the same class with the same name but different parameters.

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

Interface

A

A collection of abstract methods. It defines a contract for classes that implement it.

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

Package:

A

A way to organize related classes into a single directory. It helps in avoiding naming conflicts.

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

Access Modifiers:

A

Keywords (public, private, protected) that control the visibility of class members (attributes and methods).

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

Final Keyword:

A

A keyword used to make a class, method, or variable unmodifiable or prevent inheritance.

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

Static Keyword:

A

A keyword used to define class members that belong to the class rather than instances of the class.

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

This Keyword:

A

A keyword used to refer to the current instance of the class. It is used to distinguish between instance variables and method parameters.

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

Super Keyword:

A

A keyword used to refer to the superclass. It is used to call methods or access attributes of the superclass.

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

Method Overriding:

A

Providing a specific implementation for a method that is already defined in the superclass.

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

Method Overloading:

A

Defining multiple methods in the same class with the same name but different parameters.

18
Q

Abstract Class:

A

A class that cannot be instantiated and may contain abstract methods. It is meant to be subclassed.

19
Q

Encapsulation:

A

Bundling of data (attributes) and methods that operate on the data within a single unit (class). It restricts direct access to some of an object’s components.

20
Q

Composition:

A

A relationship between classes where one class contains an object of another class. It represents a “whole-part” relationship.

21
Q

Aggregation:

A

A form of association where one class contains an object of another class. It represents a weaker relationship compared to composition.

22
Q

Abstract Method:

A

A method without a body (implementation) defined in an abstract class or interface. Subclasses provide the implementation.

23
Q

Final Class:

A

A class that cannot be subclassed. It is marked as final using the “final” keyword.

24
Q

Final Method:

A

A method that cannot be overridden by subclasses. It is marked as final using the “final” keyword.

25
Q

Final Variable:

A

A variable whose value cannot be changed after initialization. It is marked as final using the “final” keyword.

26
Q

Static Method:

A

A method that belongs to the class rather than instances of the class. It can be called without creating an object.

27
Q

Static Variable:

A

A variable that belongs to the class rather than instances of the class. It is shared among all instances.

28
Q

Instance Variable:

A

A variable that belongs to an instance of a class. Each instance has its own copy.

29
Q

Class Variable:

A

A variable that belongs to the class rather than instances of the class. It is shared among all instances.

30
Q

Abstract Class:

A

A class that cannot be instantiated and may contain abstract methods. It is meant to be subclassed.

31
Q

Abstract Method:

A

A method without a body (implementation) defined in an abstract class or interface. Subclasses provide the implementation.

32
Q

Override Annotation:

A

An annotation used in Java to indicate that a method is intended to override a method in a superclass.

33
Q

Protected Access Modifier:

A

Access modifier that allows access within the same package and by subclasses, but not outside the package.

34
Q

Public Access Modifier:

A

Access modifier that allows unrestricted access to the class, its attributes, and methods.

35
Q

Private Access Modifier:

A

Access modifier that restricts access to the class, its attributes, and methods only within the same class.

36
Q

Default (Package-Private) Access Modifier:

A

Access modifier that allows access within the same package but not outside the package. It is the default access level.

37
Q

Getter Method:

A

A method used to retrieve the value of a private attribute. It follows the naming convention “getVariableName.”

38
Q

Setter Method:

A

A method used to set the value of a private attribute. It follows the naming convention “setVariableName.”

39
Q

Dynamic Binding:

A

The process of linking a method call to its implementation at runtime. It enables polymorphism.

40
Q

Object-Oriented Programming (OOP):

A

A programming paradigm based on the concept of objects, which represent real-world entities and have state and behavior.