LANGUAGES | C++ | C++ INTERVIEW QUESTION AND ANSWERS | 01

C++ Interview

C++ Interview Question and Answers:

1. 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.

2. 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.

3. What is C++
      C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers.

4. 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.

5. What are the basic concepts of object oriented programming?    
    It is necessary to understand some of the concepts used extensively in object oriented programming.These include
    Objects
    Classes
    Data abstraction and encapsulation
    Inheritance
    Polymorphism
    Dynamic Binding
    Message passing

No comments:

Post a Comment