KnowledgeBoat Logo
OPEN IN APP

Chapter 1 - Unit 1

Introduction to Object Oriented Programming Concepts

Class 10 - APC Understanding Computer Applications with BlueJ



Multiple Choice Questions

Question 1

In object oriented programming, the stress is given on:

  1. procedure
  2. methods
  3. class
  4. data

Answer

data

Reason — In Object Oriented Programming, the stress is put on the data values rather than functions.

Question 2

Which of the following principle does not allow to access directly from outside the class premises?

  1. data hiding
  2. encapsulation
  3. abstraction
  4. all of the above

Answer

all of the above

Reason — Data hiding, Encapsulation and Abstraction, all the three restrict direct access to data from outside a class.

Question 3

The process of combining data and functions that enables them to be together as a single entity is called

  1. inheritance
  2. encapsulation
  3. classification
  4. attributes

Answer

Encapsulation

Reason — Wrapping of data and functions of an object as a unit that can be used together in a specific operation is known as Encapsulation.

Question 4

The process by which a class acquires the properties from another class is called:

  1. polymorphism
  2. inheritance
  3. abstraction
  4. object

Answer

Inheritance

Reason — Inheritance is a property by virtue of which one class acquires some features from another class.

Question 5

In procedural programming, the stress is laid on:

  1. class
  2. function
  3. data
  4. object

Answer

Function

Reason — A programming language in which emphasis is given on the functions rather than data values is known as Procedure Oriented Programming Language.

Question 6

Which of the following is a blue print that creates objects of similar types?

  1. abstraction
  2. encapsulation
  3. class
  4. function

Answer

class

Reason — Class is a blue print that creates objects of similar types.

Question 7

Which of the following is not an object oriented programming language?

  1. C++
  2. Simula
  3. BASIC
  4. Java

Answer

BASIC

Reason — BASIC is a procedure oriented programming language.

Question 8

The process of restricting the free flow of data from the outside world is known as:

  1. encapsulation
  2. inheritance
  3. function
  4. class

Answer

encapsulation

Reason — The process of restricting the free flow of data from the outside world is known as encapsulation.

Question 9

Which of the following is true for Polymorphism?

  1. Uses same function for different operations
  2. Uses same operation for different functions
  3. It is not a principle of oop
  4. It uses reusability feature.

Answer

Uses same function for different operations

Reason — Polymorphism is the process of using a function for carrying multiple operations.

Question 10

In procedure oriented programming, the stress is given on:

  1. Data
  2. Function
  3. Object
  4. Class

Answer

Function

Reason — In procedure oriented programming, the stress is given on function or procedure.

Fill in the blanks

Question 1

Object is the fundamental concept in object oriented programming language.

Question 2

Objects can communicate with each other through function in object oriented programming language.

Question 3

Using a function for multiple operations is called as polymorphism.

Question 4

Data Abstraction is an act of representing essential features without including background details.

Question 5

Feature of wrapping data and functions as a single unit is called encapsulation.

Question 6

Inheritance promotes the reusability feature, in object oriented programming.

Question 7

Data hiding confirms the security of data members from being manipulated from unauthorized access.

Question 8

In encapsulation, data can be public or private whereas, in data hiding, data must be private only.

Write short answers

Question 1

What is object oriented programming? Name two object oriented programming languages.

Answer

Object Oriented Programming is an approach in which stress is laid on data rather than functions. The data values remain associated with the functions of a particular block of the program so as to encourage data security.

Two object oriented programming languages are C++ and Java.

Question 2

Name four basic principles of object oriented programming.

Answer

Four basic principles of object oriented programming are:

  1. Encapsulation
  2. Abstraction
  3. Inheritance
  4. Polymorphism

Question 3

Why do we prefer object oriented approach in complex programming? Explain.

Answer

Object Oriented approach offers advantages like:

  1. Data Values are secured.
  2. Mishandling of data is protected.
  3. Error detection and correction becomes easier.
  4. Easier in coding complex programs.

For these reasons, Object Oriented approach is preferred for complex programming.

Question 4

What is meant by a base class and a derived class?

Answer

The class that is inherited is known as base class and the class that inherits from the base is known as derived class.

Question 5

Mention two limitations of procedure oriented programming approach.

Answer

Two limitations of procedure oriented programming approach are:

  1. No restriction on data values.
  2. No reusability concept hence time management, testing and length of the program increases.

Question 6

What is meant by Encapsulation?

Answer

Wrapping of data and functions of an object as a unit that can be used together in a specific operation is called Encapsulation.

Question 7

Define the following with an example each.

(a) Inheritance

(b) Polymorphism

Answer

(a) Inheritance is a property by virtue of which one class acquires some features from another class. It promotes reusability.

As an example of inheritance, we can consider the case of vehicles. All vehicles have some common features like they can move on the road and transport people and goods from one place to another. These vehicles differ from each other in certain aspects like whether it transports passengers or goods, how many passengers it can accommodate at a time, whether it is a two-wheeler or four-wheeler, etc. So, we have different types of vehicles like Cars, Bikes, Scooters, Auto rickshaw, Buses, Trucks, etc. Using inheritance, we can make vehicles the base class with the different types of vehicles being the derived class as shown below:

Define Inheritance with an example. Introduction to Object Oriented Programming Concepts, APC Understanding ICSE Computer Applications with BlueJ Solutions Class 10

(b) Polymorphism is the process of using a function for carrying multiple operations. During this process, an object may include a function for multiple operations.

As an example, if we ask different animals to speak, they respond in their own way. Dog will bark, duck will quack, cat will say meow and so on. So, the same action of speaking is performed in different ways by different animals. This is the concept of Polymorphism.

Question 8

In what way is Data Hiding related to Data Abstraction?

Answer

Data Hiding and Data Abstraction are complementary concepts. Data Abstraction focuses on the observable behaviour of an object, whereas Data hiding or Data Encapsulation focuses upon the implementation that gives rise to this behaviour. In other words, Data Abstraction cares about what something does but not how it does it. Data Encapsulation cares about how something does what it does such that others don't have to worry about the implementation details. Hence, we can say that Encapsulation is a way to implement Data Abstraction.

Question 9

Give an example to explain Data Abstraction.

Answer

Data abstraction is an act of representing the essential features without knowing the background details.

As an example, lets consider the electrical switchboard. Switchboard provides us a very simple way to switch ON/OFF lights, fans and other electrical appliances. It hides all the details like the internal wiring of the house, how the switch is turning the light ON/OFF, etc.

Question 10

What is meant by Data Hiding?

Answer

The insulation of data that does not allow it to be accessed directly outside the class premises, although it is available in the same program is known as Data Hiding.

Question 11

Give two differences between Data Hiding and Encapsulation.

Answer

Two differences between Data Hiding and Encapsulation are as follows:

  1. Data hiding focuses more on data security whereas, encapsulation focuses more on hiding the complexity of the system.
  2. Data hiding focuses on restricting the use of data whereas, encapsulation deals with wrapping of data and functions.

Question 12

'Encapsulation reduces the complexity and makes the system easier'. Explain this statement with a real world example.

Answer

Encapsulation means wrapping of data and methods into a single unit and restricting direct access to some of the object's components.

Let us take the example of an ATM machine. When we want to withdraw money from an ATM machine, we swipe our card, enter the pin and then enter the amount of money we want to withdraw. The ATM machine processes our request and gives us the required money.

Here, money is treated as data and the various processes such as verification of the authenticity of the user, pin and balance in the account etc., are the methods. The data and methods are encapsulated in the ATM (which is treated as a class). Since the user doesn't have to understand the actual working of the ATM machine, encapsulation reduces the complexity and makes the system (ATM machine) easier to use.

Question 13

Give two differences between Procedure Oriented languages and Object Oriented languages.

Answer

Two differences between Procedure Oriented languages and Object Oriented languages are as follows:

Procedure Oriented languagesObject Oriented languages
Procedure Oriented languages lay emphasis on functions and procedures rather than data.Object Oriented languages lay emphasis on data rather than functions.
Limited and difficult code reusability leading to lengthy programs which are difficult to debug and maintain.Versatile and easy code reusability leading to simpler programs which are easier to debug and maintain.

Question 14

Which of the Object Oriented programming principles explain the following illustrations? Justify.

(a) The variables and methods are put together in a Class.

Which of the Object Oriented programming principles explain the following illustrations? Justify. Introduction to Object Oriented Programming Concepts, APC Understanding ICSE Computer Applications with BlueJ Solutions Class 10

(b) A man withdrawing money from ATM.

Which of the Object Oriented programming principles explain the following illustrations? Justify. Introduction to Object Oriented Programming Concepts, APC Understanding ICSE Computer Applications with BlueJ Solutions Class 10

Answer

(a) Encapsulation is illustrated in the given picture. Wrapping of data and functions of an object as a unit (class) that can be used together in a specific operation is known as Encapsulation. In the picture, the variables and methods are being encapsulated in a class.

(b) The principle of Data abstraction is illustrated here as the man withdraws money from the ATM using the withdraw option. He knows the essential features of the ATM machine such as withdrawing money, without knowing the complex background details of how the ATM machine is operating to provide money to him.

Video Explanations

PrevNext