Lecture 1 Flashcards

1
Q

What is OOP

A

Object-Oriented Programming (OOP) is a programming paradigm that models software design around objects, representing real-world entities, and their interactions.

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

What are the charateristics of OOP

A

Classes
Objects
Methods
Constructors
Encapsulation
Polymorphism,
Abstraction,
Encapsulation,
Message passing
Data Binding

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

What is a class in OOP?

A

A class is a blueprint or template that defines the attributes (properties or fields) and behaviors (methods or functions) common to all objects of a certain type.

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

What is an object in OOP?

A

An object is an instance of a class that has its own state and behavior, representing a real-world entity.

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

What is a method in OOP?

A

A method is a block of code that performs a specific task or set of tasks.

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

What are the characteristics of a method?

A

Characteristics of a method include a unique name, return type, parameters, access modifiers, and can be static (belonging to the class itself) or instance(asscoiated with an object of the class) methods. Methods can also be overloaded.

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

What is a constructor?

A

A constructor is a special member function in a class that is automatically called when an object of that class is created.

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

What is encapsulation?

A

Encapsulation involves bundling the data (attributes) and methods that operate on the data within a single unit (class) and restricting direct access to the internal state.

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

What is polymorphism?

A

Polymorphism is the ability of an object to take on multiple forms,

allowing objects of different types to be treated as objects of a common type through method overloading and method overriding.

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

What is abstraction in OOP?

A

Abstraction allows you to represent complex real-world objects in a simplified manner by focusing on essential details and ignoring non-essential details.

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

How can abstraction be implemented in OOP?

A

Abstraction can be implemented through abstract classes, interfaces, and regular classes with private methods.

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

What is message passing in OOP?

A

Message passing is a mechanism by which objects communicate with each other by sending and receiving messages.

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

What is inheritance in OOP?

A

Inheritance is a mechanism that allows a new class to be based on an existing class. Types include single, multiple, multilevel, hierarchical, and hybrid inheritance.

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

What are access modifiers?

A

Access modifiers are keywords that control the visibility of class members (e.g., variables, methods).

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

What are the different types of access modifiers in Java?

A

The types of access modifiers in Java are public, default, protected, and private.

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

What is data binding?

A

Data binding is the process of associating data with its representation in the user interface or code, ensuring synchronization between them.

17
Q

What is static data binding?

A

Static data binding, also known as early or compile-time binding, occurs at compile time, linking data with its representation before program execution.

18
Q

What is dynamic data binding?

A

Dynamic data binding, also known as late or runtime binding, occurs at runtime, linking data with its representation during program execution and allowing flexibility.

19
Q

Chateristics of objects

A

Created using the new keyword
Has a unique state, determined by its attributes
Can perform action throught its methods

20
Q

When do method overloading and method overriding occure

A

Method overloading occur at compile time while method overriding occur at runtime

21
Q

What is method overloading

A

Method overloading refers to defining multiple methods with the same name but different parameters within the same class

22
Q

What is method overriding

A

Method overriding involves creating a method in the child class that has the same name, parameters, and return type as a method in the parent class

23
Q

What are abstract classes?

A

Abstract classes are blueprints that define a general structure and functionalities for subclasses.
They enforce abstraction by having abstract methods (without implementation) that subclasses must implement to be useful.

24
Q

What are interfaces

A

Interfaces specify what functionalities a class must have but don’t provide any implementation details.

Classes implementing an interface must provide their own code for the specified methods.

25
Q

what are chateristics of abstractions

A

Focuses on essential properties and behaviors.

Reduces complexity and enhances understandability.

Provides a clear and concise view of the system.

26
Q
A
27
Q

chateristics of message passing

A

Objects interact through method calls.
Supports the exchange of information between objects.
Facilitates collaboration and cooperation between objects.

28
Q

master the code for message passing

A
29
Q

what is single inherintance

A

Single inheritance is a type of inheritance in which a subclass inherits from a single superclass.

30
Q

what is multiple inherintance

A

Multiple inheritance is a type of inheritance in which a subclass inherits from multiple super classes.

Multiple inheritance can be implemented in Java by using multiple interfaces.

30
Q

what is mulitilevel inherintance

A

Multilevel inheritance is a type of inheritance in which a subclass inherits from a superclass, which in turn inherits from another superclass.

31
Q

what is hierarchical inherintance

A

Hierarchical inheritance is a type of inheritance in which a single superclass is inherited by multiple subclasses.

32
Q

what is hybrid inherintance

A

Hybrid inheritance is a combination of more than two types of inheritances single and multiple.

33
Q

chateristics of static data biding

A

The linkage between data and its representation is determined during the compilation phase.

34
Q

chateristics of dynamic data binding

A

The linkage between data and its representation is determined dynamically during program execution.

Allows flexibility and adaptability in the program’s behavior.