Lesson 1 Flashcards

1
Q

A programming approach that organizes code around objects (things with data and behavior) instead of focusing on just functions and logic.

A

Object-Oriented Programming (OOP)

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

Great for large, complex programs that need to be regularly updated or maintained, like simulations, design software, and mobile apps.

A

OOP is best suited for large, complex, and actively updated programs.

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

Benefits of Object-Oriented Programming

A
  1. Code Reusability: Reuse parts of code in different projects.
  2. Scalability: Easily add features as your project grows.
  3. Efficiency: Organizes code for faster development and debugging.
  4. Collaborative Development: Makes teamwork easier by dividing projects into smaller tasks.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is like a blueprint for creating objects. It defines what attributes (data) and methods (functions) an object will have.

A

A class defines the blueprint for objects, their attributes, and methods.

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

Is a specific instance created from a class. It has its own data and can perform actions (methods).

A

An object is an instance of a class with its own data and behavior.

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

Are the data inside an object, defined in the class, that represent the object’s state.

A

Attributes are data that represent the state of an object.

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

Are functions that belong to an object, defining its behavior or actions.

A

Methods

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

Procedural Programming vs OOP

A

In Procedural Programming, the focus is on functions manipulating data. In OOP, the focus is on objects with data and behavior (methods).

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

Hides the complex details and only shows the essential information. Example: You drive a car without needing to know how the engine works.

A

Abstraction hides complexity and shows only relevant information.

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

Keeps an object’s data safe and hidden from outside interference. Only the object’s methods can access its data.

A

Encapsulation protects an object’s data from unauthorized access.

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

Lets one class (child) inherit attributes and methods from another class (parent). The child can change or add new features.

A

Inheritance allows a child class to inherit attributes and methods from a parent class.

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

Allows methods to work in different ways. In Java, it can happen through method overloading or method overriding.

A

Polymorphism allows methods to perform actions in different ways.

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

Is a general relationship between two classes. For example, a Car and a Bicycle might interact, but they’re not directly connected.

A

Association is a general relationship between two unrelated classes.

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

Is a HAS-A relationship. One class (like a Passenger) can have another class (like a Car), but the Car doesn’t depend on the Passenger.

A

Aggregation

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

Is a stronger form of aggregation where two classes depend on each other. For example, a Car and an Engine cannot exist without each other.

A

Composition

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