Wednesday, 8 January 2014

C++ Interview Question and Answers : 2

Posted by Pritam  |  at  19:44 No comments


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

                   <<<PREV                                                                                             NEXT>>>          

About the Author

Write admin description here..

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

Related posts

0 comments:

We Will Appreciate Your Comment As Complement

© 2013 Knowledge To Grab. WP Theme-junkie converted by K-Grab
Blogger templates. Proudly Powered by Blogger.
back to top