CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 3. OBJECT ORIENTED PROGRAMMING Eg:class Rectangle Eg: Here in the above class the data members ie len,bre,area and the member functions ie readData( ), calculate( ), display( ) are bind together in a class named as Rectangle. Ie The member functions can access any data member in the class.
2004 1.a. What is polymorphism? Give an example in C ++ to show its implementation in C++. Ans: Polymorphism is the attribute that allows one interface to be used with different situation.C++ implements polymorphism through virtual functions, through overloaded functions and overloaded operators. A virtual function is used to specify the interface in abstract class, but its implementation details are made available by the concrete class(es). 2003: 2.a. What do you understand by function overloading? Give an example illustrating its use in a c++ program. Ans: A function name having several definitions that are differentiable by the number or types of their arguments, is known as an overloaded function and this process is known as function overloading. |
|