1. 2. What the basic concepts are of object oriented programming?
It is necessary to understand some of the concepts used extensively in object oriented programming.These include
c. Data abstraction and encapsulation
f. Dynamic Binding
g. Message passing
2. Define inheritance?
The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch. Inheritance is the process by which objects of one class acquire properties of objects of another class.
3. Define polymorphism?
Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name in a program.It allows us to have overloading of operators so that an operation can exhibit different behaviours in different instances.
4. What are the features of C++ different from C?
a. All the features of C issimilar to C++ except some features, such as polymorphism, operator overloading which are supported in C++ but not in C language.
b. Both C and C++ language is similiar in their functionality but C++ provides with more tools and options.
5. What is encapsulation?
The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.
6. What is message passing?
An object oriented program consists of a set of objects that communicate with each other. Message passing involves specifying the name of the object, the name of the function and the information to be sent.
7. What are tokens in C++?
The smallest individual units of a program is known as tokens. c++ has the following tokens :
8. What is the use of enumerated data type?
An enumerated data type is another user defined type which provides a way for attaching names to numbers thereby increasing comprehensibility of the code. The enum keyword automatically enumerates a list of words by assigning those values 0,1,2, and so on.
9. What is the use of default constructor?
A constructor that accepts no parameters is called the default constructor. If no user-defined constructor exists for a class A and one is needed, the compiler implicitly declares a default parameter less constructor A::A(). This constructor is an inline public member of its class. The compiler will implicitly define A::A() when the compiler uses this constructor to create an object of type A. The constructor will have no constructor initializer and a null body.
10. Define Constructors?
A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class.