0% found this document useful (0 votes)
51 views4 pages

Basic Concepts of OOP

Uploaded by

clpatil2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

Basic Concepts of OOP

Uploaded by

clpatil2007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Ch.

6 Basic concepts of OOP


One mark questions:
1. What is the fundamental idea of object oriented programming?
A. The fundamental idea of object oriented programming is that the programs are built
by combining data and functions that operate on data into a single unit called object.
2. What is an object?
A. An object is a collection of data members and associated member functions.
3. Define the term class.
A. A class is a way of grouping objects having similar characteristics.
4. Define the term data abstraction.
A. Abstraction refers to the process of representing essential features of an object
without including background details or explanation.
5. What is encapsulation?
A. Data encapsulation is a way of combining data and associated functions into a single
unit called class.
6. What is meant by function overloading?
A. Function overloading means two or more functions have same name, but differ in
the number of arguments or data type of arguments.
7. Define polymorphism.
A. The ability of an operator and function to take multiple forms is known as
polymorphism.
8. What is inheritance?
A. The process of forming a new class (derived class) from an existing class (base class)
is known as inheritance.
9. What is base class?
A. A class which is used to create another class is called base class or super class.
10. What is a derived class?
A. The class that inherits the properties from another class is known as derived or
subclass.
11. How are base class and derived class related
A. The base class is used to create the derived class. The derived class shares some of
the properties of the base class. Therefore some of the members of a base class can
be reused in a derived class.
12. Define the term data hiding.
A. The concept of insulating the data from direct access by the program is called data
hiding.
Two marks questions:
1. What is the significance of classes in OOP?

A. A class is a way of grouping objects having similar characteristics. Classes are user
defined data types. Once a class is defined, any number of objects of the class can be
created.

2. What is the difference between program module and an object?

PROGRAM MODULE OBJECT


1. Program module consists of a 1. Object consists of data members
series of instructions which are and member functions.
used to perform a specific task.
2. For every task we need to write a 2. Many member functions can be
separate program module. included in the same object.

3. Mention different types of inheritance.


A. The different types of inheritance are Single inheritance and multiple inheritance. In
single inheritance, each subclass has only one super class. In multiple inheritance,
each subclass has more than one super class.
4. Mention any two advantages of object oriented programming over earlier
programming methods.
A. (1) The programs are modularized based on the principle of classes and objects.
(2) Data is encapsulated along with functions. Therefore, external non-member
functions cannot access or modify data, thus providing data security.

Three marks questions


1. Briefly discuss the classes and objects.

A. Objects are basic building blocks for designing programs. An object is a collection of
data members and associated member functions. Every object must be a member of
a particular class.

A class is a way of grouping objects having similar characteristics. Once a class is


defined, any number of objects of that class is created. Classes are user defined data
types.

Ex: Apple, orange, mango are the objects of class fruit.

2. Explain inheritance.

A. The process of forming a new class from an existing class is known as Inheritance.
The existing class is known as base class. The new class is known as derived class. The
derived class shares some of the properties of the base class. In OOP, the concept of
inheritance provides the idea of reusability.

3. Write short notes on polymorphism.

A. The ability of an operator and function to take multiple forms is known as


polymorphism. There are two types of polymorphism:

(1) Operator overloading: When an operator behaves differently based on operands,


then it is said that the operator is overloaded.

(2) Function overloading: Function overloading means two or more functions have
same name but differ in the number of arguments or data type of arguments.

4. Mention any 4 high level languages that follow object oriented programming
approach.
A. C++, Java, C#, Simula are the high level languages that follow object oriented
programming approach.

Five marks questions


1. Write the differences between procedural programming and object oriented
programming.

Procedural Programming Object Oriented Programming


1. Emphasis is on procedure 1. Emphasis is on data rather than
rather than data procedure
2. Large programs are divided into 2. Programs are divided into
smaller programs known as objects
functions
3. Follows top-down approach in 3. Follows bottom-up approach in
program design program design
4. Data may communicate with 4. Objects may communicate with
each other through functions each other through functions
5. Data is not hidden and can be 5. Data is hidden and cannot be
accessed by external non- accessed by external non-
member functions member functions

2. Explain advantages of OOPs. (any 5 points)


A. The main advantages of Object Oriented Programming are:
(1) The programs are modularized based on the principle of classes and objects.

(2) Linking code and object allows related objects to share common code. This
reduces code duplication and enhances code reusability.
(3) Data is encapsulated along with functions. Therefore, external non-member
function cannot access or modify data, thus providing data security.

(4) Easier to develop complex software, because complexity can be minimized


through inheritance.

(5) The concept of data abstraction separates object specification and object
implementation.

(6) Creation and implementation of OOP code is easy and reduces software
development time.

(7) OOP can communicate through message passing which makes interface
description with outside system very simple.

3. Write the disadvantages of object oriented programming.

A. The main disadvantages of using Object oriented programming are:

(1) OOP software is not having a set of standards

(2) The adaptability of flow diagrams and object oriented programming using
classes and objects is a complex process

(3) To convert a real world problem into an object oriented model is difficult

(4) The classes are overly generalized

4. Write the real life applications of object oriented programming. (any 5 points)

A. The common application areas of Object oriented programming are:

(1) Computer graphic applications

(2) CAD/CAM software

(3) Object-oriented database

(4) User Interface design such as windows

(5) Real-time systems

(6) Simulation and Modelling

(7) Artificial intelligence and expert systems

You might also like