CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 3. OBJECT ORIENTED PROGRAMMING Example program illustrating function overloading: //Program to find out area of a circle or area of rectangle using void area(float l,float b) 2000: 1.a. Illustrate the concept of function overloading with the help of an example. 1 Ans: The above answer. 1998: 1.a. Define the following terms: (i) Inheritance (ii)Encapsulation. Ans: i. Inheritance: The capability of one class to inherit properties from another class is called as inheritance. The class inheritance, lets you generate a model that is closer to the real world. The class inheritance lets you derive new classes (derived class) from old ones (base class), with the derived class inheriting the properties, including the methods of the old class. a. Capability to express the inheritance relationship which ensures the closeness with the real world models. ii. Encapsulation: The wrapping up of data and functions into a single unit (class) is called as encapsulation |