NCERT Solutions Class 12 Computer Science Object Oriented Programming in C++. NCERT book for Computer Science in class 12 is strongly recommened by teachers and the CBSE and NCERT boards. Please download the NCERT solutions for class 12 Computer Science free in PDF made by teachers of the best schools in India. These solutions are carefully compiled to give detailed understanding of the concepts and also steps of solutions. The NCERT solutions are free to download in pdf format. Please refer to the download link below to download the pdf file and also refer to other chapters and subjects to get the solutions to Computer Science NCERT book questions and exercises.
Chapter - Object Oriented Programming in C++
Question 1: Differentiate between data abstraction and data hiding. [Delhi, 2015]
Answer: Data hiding can be defined as the mechanism of hiding the data of a class from the outside world. This is done to protect the data from any accidental or intentional access. Data hiding is achieved by making the members of the class private. Data abstraction refers to, providing only essential information to’ the outside world and hiding their background details. Members defined with a public label are accessible to all parts of the program. The data abstraction view of a type is defined by its public members.
Question 2: How encapsulation and abstraction are implemented in C++ language ? Explain with an example. [CBSE SQP 2015]
Answer: Abstraction refers to the act of representing essential features without including the background details or explanations. Encapsulation is wrapping up of data and function together in a single unit. We can say that encapsulation is way of achieving abstraction. Both these concepts are implemented in C++ in the form of a class. In a class data and function members are wrapped together. Only essential features are shown to the outside world in the form of member functions with public mode of accessibility. [1]
Example: [1]
class Rectangle
{
int L, B;
public: void Input()
{
cin>>L>>B;
}
void Output()
{
Cout<<L<<B;
}
};
In this example:
Data and member functions are together encapsulated Only Input ( ) and Output ( ) functions are visible outside the class which can only can be accessed outside the class using objects of the same class – Abstraction
Please click on link below to download NCERT Solutions Class 12 Computer Science Object Oriented Programming in C++.
