Chapter 1 - Unit 1
Introduction to Object Oriented Programming Concepts
Class 10 - APC Understanding Computer Applications with BlueJ
Tick the correct option
Question 1
In object oriented programming, the stress is given on:
- procedure
- methods
- class
- data ✓
Question 2
Which of the following principle does not allow to access directly from outside the class premises:
- data hiding
- encapsulation
- abstraction
- all of the above ✓
Question 3
The process of combining data and functions that enables them to be together as a single entity is called
- inheritance
- encapsulation ✓
- classification
- attributes
Question 4
The process by which a class acquires the properties from another class is called:
- polymorphism
- inheritance ✓
- abstraction
- object
Question 5
In procedural programming, the stress is laid on:
- class
- function ✓
- data
- object
Question 6
A ............... is a set of objects that has common attributes and common behavior.
- abstraction
- encapsulation
- class ✓
- function
Question 7
Which of the following is not an object oriented programming language?
- C++
- Simula
- BASIC ✓
- Java
Question 8
The process of restricting the free flow of data from the outside world is known as:
- encapsulation ✓
- inheritance
- function
- class
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 principle of object oriented programming promotes reusability feature.
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:
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
Question 3
Why do we prefer object oriented approach in complex programming? Explain.
Answer
Object Oriented approach offers advantages like:
- Data Values are secured.
- Mishandling of data is protected.
- Error detection and correction becomes easier.
- 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:
- No restriction on data values.
- 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 that operate on that data into a single unit is called Encapsulation.
Question 7
Define the following with an example each.
(a) Inheritance
Answer
Inheritance enables new classes to receive or inherit the properties and methods of existing classes. Example of Inheritance is ......
(b) Polymorphism
Answer
In object-oriented programming, Polymorphism provides the means to perform a single action in multiple different ways. Example of Polymorphism is given......
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
Example of Data Abstraction is given ........
Question 10
What is meant by Data Hiding?
Answer
Data Hiding means restricting direct access to the implementation details of an object and providing a well defined public interface through methods to use the functionality of the object.
No comments:
Post a Comment
any problem in any program comment:-