Professional Documents
Culture Documents
Computer CH 1, Unit 1
Computer CH 1, Unit 1
Question 1
What is object oriented programming? Name two object oriented programming
languages.
Answer
Question 2
Name four basic principles of object oriented programming.
Answer
Encapsulation
Abstraction
Inheritance
Polymorphism
Question 3
Why do we prefer object oriented approach in complex programming? Explain.
Answer
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
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 given here.
(b) Polymorphism
Answer
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
Question 10
What is meant by Data Hiding?
Answer