C++ Interview Question and Answers

6. 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.
 
Srimathy,says Feb 09, 2018
Encapsulation is basic concept of c++ and hiding the data is called encapsulation.
Anand Kamale,says Sept 20,2017
Encapsulation is the wrapping of data and fun into single unit ex.(class & Java bean class).
Upendra yadav,says May 06,2014
Packaing an object's within this method is called encapsulastion.
Pankaj Pandey, said Mar 08,2014
Encapsulatio is besic concept of object oriented programming language. It is combination of Data and Code. syntax. { ............ private: : int x, y, z; : public: : encapsulation void show(); : } ......
Your Name Your Email-ID
Your Answer
7. 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.
 
Shashi kant, said Feb 07,2014
Message passing is the process which receives the information from one object to another. for example a bank manager receives the information to the customer for bank balance.
Your Name Your Email-ID
Your Answer
8. What are tokens in C++?
 
    The smallest individual units of a program is known as tokens. c++ has the following tokens :
  • Keywords
  • Identifiers
  • Constants
  • Strings
  • Operators
 
Your Name Your Email-ID
Your Answer
9. 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 them values 0,1,2, and so on.
 
Your Name Your Email-ID
Your Answer
10. What is the use of default constructor?
  A constructors 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 parameterless 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.
 
Your Name Your Email-ID
Your Answer