Flashcards: Foundations of Object-Oriented Programming — 40 cards

All cards

1Question

What is a programming language?

Answer

A language used to write instructions for a computer.

2Question

Name some examples of programming languages.

Answer

Python, Java, C, C++, and JavaScript.

3Question

What is procedural programming?

Answer

A programming approach using a sequence of steps executed top to bottom.

4Question

How does procedural programming execute instructions?

Answer

From top to bottom in sequence.

5Question

What is the first step in the procedural sequence for making tea?

Answer

Boil water.

6Question

What is the last step in the procedural sequence for making tea?

Answer

Serve the tea.

7Question

What is a main limitation of procedural programming regarding code reuse?

Answer

Procedural programming has poor code reusability.

8Question

Why is error checking difficult in procedural programming for large programs?

Answer

Because procedural programming leads to dependent code making error checking hard.

9Question

Which programming paradigm is unsuitable for real-world applications due to maintenance issues?

Answer

Procedural programming is unsuitable for real-world applications due to difficult maintenance.

10Question

What is object-oriented programming?

Answer

An approach designing software using classes and objects representing real-world entities.

11Question

Which elements does object-oriented programming combine into objects?

Answer

Data and the functions that operate on it.

12Question

Why is code reusability important in object-oriented programming?

Answer

It is achieved through inheritance.

13Question

How does object-oriented programming enhance code security?

Answer

By using access control.

14Question

What does object-oriented programming use to hide unnecessary details?

Answer

Abstraction and encapsulation.

15Question

How does object-oriented programming manage complexity?

Answer

By managing complexity level by level.

16Question

What is a class in programming?

Answer

A class is a user-defined data type and blueprint containing data members and member functions.

17Question

What does an object represent in programming?

Answer

An object is an identifiable instance of a class representing a real-world entity through state and behaviour.

18Question

What represents an object's state?

Answer

An object's state is represented by its attributes.

19Question

What represents an object's behaviour?

Answer

An object's behaviour is represented by its methods and responses to other objects.

20Question

What is a data member in a class?

Answer

A data member is a variable declared inside a class.

21Question

Give examples of data members in a student class.

Answer

Examples include roll number, name, or marks.

22Question

What is a method in a class?

Answer

A method is a block of code defined inside a class that performs a specific task.

23Question

What is encapsulation in object-oriented programming?

Answer

Encapsulation is wrapping data and functions into a single unit with controlled access.

24Question

How does data abstraction differ from information hiding?

Answer

Data abstraction shows essential info while hiding details; information hiding protects sensitive data.

25Question

What is inheritance in object-oriented programming?

Answer

Inheritance allows a class to derive properties from another class.

26Question

What does polymorphism enable in object-oriented programming?

Answer

Polymorphism allows operations to appear in multiple forms with different behaviors.

27Question

What is binding in programming?

Answer

Binding associates a method call with the actual method executed.

28Question

What is static binding also called?

Answer

Early binding.

29Question

When does static binding link a method call to its implementation?

Answer

At compile time.

30Question

When does dynamic binding link a method call to its implementation?

Answer

At runtime based on the actual object.

31Question

How does static binding compare to dynamic binding in speed and flexibility?

Answer

Static binding is faster and less flexible.

32Question

Why is dynamic binding more flexible but slower?

Answer

Because its method is determined during execution.

33Question

What is message passing in object-oriented programming?

Answer

One object sends a request to another to invoke a method and perform an operation.

34Question

What does code reusability mean in OOP?

Answer

Writing code once and using it multiple times.

35Question

How does OOP achieve code reusability?

Answer

Through inheritance and reusable classes or methods.

36Question

What is data redundancy?

Answer

Storing the same piece of data in two separate places.

37Question

How can reusable common class definitions reduce data redundancy?

Answer

By reducing repeated functionality across classes.

38Question

How does OOP improve code maintenance?

Answer

By allowing existing code to be modified without repeated rework.

39Question

What does OOP security protect?

Answer

An object's data from unauthorized or accidental access.

40Question

How does OOP mainly protect data security?

Answer

Through encapsulation and data hiding.

Test yourself with the quiz

Test your knowledge with 18 questions on Foundations of Object-Oriented Programming.

1. What is the primary purpose of a programming language?

2. Which sequence best illustrates procedural programming when making tea?

Take the quiz →

Read the study sheet

Review the complete course in the study sheet for Foundations of Object-Oriented Programming.

See study sheet →

Similar courses

Create your own flashcards

Import your course and AI generates flashcards in 30 seconds.

Flashcard generator