You can Download Chapter 6 Basic Concepts of OOP Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.
Karnataka 2nd PUC Computer Science Question Bank Chapter 6 Basic Concepts of OOP
2nd PUC Computer Science Basic Concepts of OOP One Mark Questions and Answers
What is the fundamental idea of object oriented programming?
Object-oriented programming (OOP) is a programming language model organized around “objects” rather than “actions” and data rather than logic of the program.
What is an object?
An object is a combination of code and data that can be treated as a unit. An object can be considered any real time entity (existing thing) that can perform a set of related activities.
Define the term class.
The class is a collection of objects that have the similar properties and common behaviour.
Define the term data abstraction.
The process of hiding the representation of various data items and implementation details of a function from the user program is called data abstraction.
What is encapsulation?
It is the method of combining the data, attributes and methods in the same entity is called encapsulation.
What is meant by function overloading?
Two or more functions with the same name is called function overloading.
Polymorphism is a Greek word that means Many Shapes. In OQP Polymorphism means the ability to take on many forms. The term is applied both to objects and to functions.
What is inheritance?
Inheritance is the process by which new objects can acquire the properties of an existing objects of other class.
What is a base class?
A base class is a class, in an object-oriented programming language, from which other classes are derived.
What is a derived class?
A derived class is a class created or derived from another existing class.
How are base class and derived class related?
The hierarchical relationship between derived class and base class is known as an “is a” relationship.
Define the term data hiding.
Data Hiding is the mechanism where the details of the class are hidden from the user.
What do you mean by dynamic binding?
It means code associated with a procedure call is known only at the time of execution of program. It is the process of connected one program block to another.
What is message passing?
It is the process of specifying the name of objects, name of the function and the information to be sent.
Mention the two types of overloading.
The two types of overloading is operator overloading and function overloading.
2nd PUC Computer Science Basic Concepts of OOP Two Marks Questions and Answers
What is the significance of classes in OOP?
The Class allow to group functions and data variables. The class is a way to grouping objects having similar characteristics. The objects can be made user defined data type with the help of a class.
What is the difference between program module and an object?
A program module is a self-contained independent program segment only it does not provide security to data whereas an object is a collection of data members and member functions that operate on data and data is provided with security.
Mention different types of inheritance.
The different types of inheritance are single inheritance, multilevel inheritance, multiple inheritance, hierarchical inheritance and hybrid inheritance.
Mention any two advantages of object oriented programming over earlier programming methods.
- OOP provides useful features like Inheritance, polymorphism and encapsulation, not available in earlier programming methods.
- Once an Object is created, knowledge of its implementation is not necessary for its use. In older programs, coders needed understand the details of a piece of code before using it in this or another program.
Explain the structure of object.
The object is a collection of data members and member function. Objects occupy space in memory and have address associated with them. Objects interact by sending messages to one another.
Explain data encapsulation.
The data encapsulation is a technique that combines data and functions into a single unit called class. Here, data can be accessed through member function only present inside the class. Data encapsulation enables data hiding or information hiding.
2nd PUC Computer Science Basic Concepts of OOP Three Marks Questions and Answers
Briefly discuss the classes and objects.
A class is a definition of an object. It is data type just like int. A class is a type, and an object of this class is just like a variable. In other words, class is a blue print and object can be considered as any real time entity (existing thing) that can perform a set of related activities.
Inheritance is the process of creating new classes, called derived class, from existing or base classes. The derived class inherits all the capabilities of the base class. Using Inheritance some qualities of the base classes are added to the newly derived class, apart from its own features. Inheritance permits code reusability.
Write short notes on polymorphism.
The polymorphism is ability of an object to take more than one form in different instances. For example, one function name can be used for different purposes. Similarly, same operator can be used for different operations. There are of two types one is the “compile time polymorphism” and other one is the “run-time polymorphism”.
Mention any 4 high level languages that follow object oriented programming approach.
The four high level languages that follow object oriented programming approach are
- Visual Basic
2nd PUC Computer Science Basic Concepts of OOP Five Mark Questions and Answers
Write the differences between procedural programming and object oriented programming.
Difference between Procedure Oriented Programming (POP) & Object Oriented Programming (OOP)
|Procedure Oriented Programming
|Object Oriented Programming
|In POP, program is divided into small parts called functions.
|In OOP, program is divided into parts called objects.
|In POP, Importance is not given to data but to functions as well as sequence of actions to be done.
|In OOP, Importance is given to the data rather than procedures or functions.
|POP follows Top Down approach.
|OOP follows Bottom Up approach.
|POP does not have any access specifier.
|OOP has access specifiers named Public, Private, Protected, etc.
|In POP, Data can move freely from function to function in the system.
|In OOP, objects can move and communicate with each other through member functions.
|To add new data and function in POP is not so easy.
|OOP provides an easy way to add new data and function.
|POP does not have any proper way for hiding data so it is less secure.
|OOP provides Data Hiding so provides more security.
|In POP, Overloading is not possible.
|In OOP, overloading is possible in the form of Function Overloading and Operator Overloading.’
Explain advantages of OOPs.
- OOP provides a dear modular structure for programs. Large problems can be reduced to smaller and more manageable problems.
- In OOP, data can be made private to a class such that only member functions of the class can access the data. This principle of data hiding helps the programmer to build a secure program.
- Implementation details are hidden from other modules and other modules has a clearly defined interface.
- It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
- With the help of polymorphism, the same function or same operator can be used for different purposes. This helps to manage software complexity easily.
- In OOP, programmer not only defines data types but also deals with operations applied for data structures.
- It is easy to model a real system as real objects are represented by programming objects in OOP.
- With the help of inheritance, we can reuse the existing class to derive a new class such that the repetition of code is eliminated and the use of existing class is ex¬tended. This saves time and cost of program.
Write the disadvantages of object oriented programming.
The few dis-advantages of OOP are
Object Oriented programs are much larger than other programs. In the early days of computing, space on hard drives, floppy drives and in memory was at a premium. Today we do not have these restrictions.
Object Oriented programs require a lot of work to create. Specifically, a great deal of planning goes into an object oriented program well before a single piece of code is ever written. Initially, this early effort was felt by many to be a waste of time. In addition, because the programs were larger (see above) coders spent more time actually writing the program.
Object Oriented programs are slower than other programs, partially because of their size. Other aspects of Object Oriented Programs also demand more system resources, thus slowing the program down.
4. Not suitable for all types of problems:
There are problems that lend themselves well to functional-programming style, logic -programming style, or procedure-based programming style, and applying object-oriented programming in those situations will not result in efficient programs.
5. Not all programs can be modeled accurately by the objects model. If you just want to read in some data, do something simple to.it and write it back out, you have no need to define classes and objects. However, in some OOP languages, you may have to perform this extra step.
6. The objects often require extensive documentation.
Write the real life applications of object oriented programming.
Some of the real life applications of object oriented programming are given below;
- Computer graphic applications
- CAD/CAM software
- Object oriented database
- User interface design such as windows
- Real time systems
- Simulation and modeling
- Artificial intelligence and expert systems.