Select chapter



constructors (2.papers)
inheritance (1.papers)
overriding (1.papers)
basics (4.papers)
pointers (2.papers)
Hide

Sponsored Links


  

c++ basics interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
Who invented c++ language?
  1. Steve Jobs
  2. Dennis Ritchie
  3. Ken thomson
  4. Bjarne StrouStrup
Show Answer
Share Facebook gmail Twitter
3
C++ is
  1. Object oriented programming language
  2. Structured programming language
  3. Procedural language
  4. Scripting language
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
What is an abstract class?
  1. It is an incomplete class.
  2. Abstract class may contain 0 or more number of abstract methods.
  3. Both option 1 and 2 are correct
  4. option 1 is correct, but option 2 is not correct because if a class is having 0 abstract methods then you can't make that class as abstract class.
Show Answer
Share Facebook gmail Twitter
6
Does c++ support struct?
  1. yes
  2. no
  3. Can't say
  4. Question is ambiguous
Show Answer
Share Facebook gmail Twitter
7
What is the difference between struct and class in c++?
  1. By default members of class are public, and members of a struct are private.
    
  2. There is no difference
  3. By default members of struct are public, and members of a class are private.
    
  4. none
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
What is a class?
  1. Class is an instance of an object.
    class is a real entity, it will have real physical existence.
    
  2. It is a blueprint from which we can generate individual objects.
    class is virtual entity, it doesn't have real existence.
    
  3. Both are correct
  4. None are correct
Show Answer
Share Facebook gmail Twitter
11
What is an object?
  1. It is a blueprint .
    object is virtual entity, it doesn't have real existence.
    
  2. An instance of a class is called as object.
    object is a real entity, it will have real physical existence.
    
  3. Both are correct
  4. None are correct
Show Answer
Share Facebook gmail Twitter
12
What is inheritance?
  1. Inheritance is acquiring the properties from base class to derived class, so that we can reuse the code of existing class easily.
    
  2. Wrapping up of data and behaviors together in a single box is called as inheritance
  3. Having same function name with different number of parameters in same class is called as inheritance
  4. none
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
What is polymorphism? Give one example?
  1. Inheriting properties from base class to derived class is called as polymorphism.
    Example class B inheriting from class A.
  2. Having more than one form is called as polymorphism.
    Function over loading, where we will have two functions with same name but different parameters is an example.
    
  3. Wrapping up of data and behaviors together in a single box is called as polymorphism. Eg: class Student{…}
  4. none
Show Answer
Share Facebook gmail Twitter
15
What is a constructor?
  1. We use constructors to initialize instance variables.
  2. It is a special function, which will be having same name as class name. This will be called immediately after creating object.
    
    
  3. Both option 1 and 2 are correct
  4. none
Show Answer
Share Facebook gmail Twitter
16
What is a destructor?
  1. It is a special function, which will be having same name as class name with a tild mark (~) before the function name.
    
  2. Destructors are used to destroy the objects created.
  3. both option 1 and 2 are correct
  4. none
Show Answer
Share Facebook gmail Twitter
17
If i have same variable name for local and global variable, then how to access global variable?
  1. Use pointers (*)
  2. Use address operator (&)
  3. Use scope resolution operator (::)
  4. It is impossible to access global variable, if you are giving same name for local variables.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
What is a reference variable in c++?
  1. Pointers are called as reference variables
  2. It is a kind of alias for a variable.
  3. There is nothing like references in c++.
  4. none
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :