14. CPP-Important Points and Interview Questions

CPP Hierarchical Inheritance: Previous                                                Learn Core Java
  1. How many keywords are in C++? [63 keywords]
  2. What is reference variable in C++? 
Ans: these variables are used t give name to previously defined variable.

  1. C++ allow the declaration of variable anywhere in scope? [Yes]
  2. for(int i =0; i<10 i="" span="">
Is it a correct syntax in C++?                   [Yes]
  1. What are Tokens?
Ans: it is smallest unit of a program that contains keywords, identifiers, constants, operators all same as ‘C’.
  1. new or delete are Unary operator or Binary operator? [Unary Operator]
  2. What are manipulator?
Ans: Manipulators are used to format the display. endl and setw are manipulators.
  1. All basic control structure[if, if-else, loops, switch]are same as ‘C’ supports? [Yes]
  2. Return datatype of main( ) is? [int]
  3. Write down the name of two function in C++ and are not supported by ‘C’? [Friend and Virtual]
  4. What are member function and data member of a class?
Ans: Variables declare in a class are known as data members or function declared in class are known as member functions.
  1. What is default access modifier of data member of class? [private]
  2. What is Encapsulation?
Ans: Binding of data member and member function into a single unit is process of Encapsulation.
  1. Is member function of class can be declared outside the class? How?
Ans: Yes, they can be declared but with class name with they belong and scope resolution operator[::]
Eg:           void student :: display( )
  1. What are Objects?
Ans: they are runtime entity that contains data members or member functions of the class with they belong.
  1. Describes the behavior of Access modifiers in Inheritance?
Types of InheritancePrivateProtectedPublic
Class student: private personXPrivatePrivate
Class student: protected personXProtectedProtected

  1. ‘super’ keyword is allowed in C++?       [No]
  2. Write down any 3 main difference between constructor destructor?
1. It is called at the time of memory allocation.1. It is called at time of memory de-allocation.
2. Constructors can be parameterized as well as non-parameterized also.2. Destructor can`t be parameterized
3. Overloading of constructor is possible.3. Overloading is not possible.

  1. What is containership or nesting?
Ans: A class can contain objects of other classes this is known as containership or nesting.
  1. For what ‘this’ operator refers to?
Ans: A ‘this’ operator refers to an object that currently invokes a member function.
  1. What is type conversion?
Ans: A conversion of a value from one type to another.
  1. Define the scope of a variable?
Ans: the scope of variable is the portion of program where particular variable is accessible.
  1. What is Overloading?
Ans: the ability to change the definition of an inherited method in a subclass.
  1. What is pseudo code?
Ans: A code which is written in easy to read language without worrying about the syntaxes of language.
  1. What do you understand by executive file?
Ans: A file containing machine code that has been linked and is ready to be run on computer.
  1. What is hierarchy of class?
Ans: it is class networks, which consists of a base class and derived class.
  1. What is coding?
Ans: The act of writing a program in computer language.
  1. What is Bit?
Ans: A binary digit, either of digits 0 or 1.
  1. What is C++?
Ans: An object oriented language developed by BjarneStroustrup and it is successor of ‘C’.
  1. Why comments are made?
Ans: To make a program more readable.
CPP Hierarchical Inheritance: Previous                                                Learn Core Java