C++ Programming Questions Answers - Set 2 Online Quiz Test
-
1. The members of a class are ?
b) by default are private
c) are made private by declaring as private
d) none of the above]
- have no visibility by default
- public by default
- private by default
- protected by default
-
2. The function used to define the task assigned to an operator is ?
- Virtual function
- Static function
- Operator function
- Friend function
-
3. Which operators can not be overloaded ?
- Binary operator
- Ternary operator
- Unary operator
- All can be overloaded
-
4. Classes in c++ are ?
- Fundamental data type
- Primitive data type
- Desired data type
- Not defined
-
5. 37. Which of the following statements is false ?
- Using typedef does not replace the standard C++ data type name with the new name
- The new name defined by typedef, can be used as a type for another typedef
- typedef defines new data types
- None of the above
-
6. 66. A constructor function is generally defined
- In the private section of a class
- In the public section of a class
- In the protected section of a class
- None of the above
-
7. The symbol ** __ .
- can be overloaded by changing its datatype.
- cannot be overloaded, as on overloading its meaning shall be changed.
- can be overloaded.
- cannot be overloaded as it is not a C++ operator.
-
8. Only one copy of the class is inherited, when it is defined as ?
- virtual
- public
- static
- private
-
9. && means ?
- Logical OR
- Bitwise OR
- Logical AND
- Bitwise AND
-
10. Explicit call to a constructor means ?
- Not providing the construction name at all
- Is the shorthand method
- Providing the constructor name explicitly to invoke it
- Providing the constructor name implicitly to invoke it
-
11. 78. If new operator is used, then the constructor function is ?
- Copy constructor
- Default constructor
- Static constructor
- Dynamic constructor
-
12. The antonym of constructor is ?
- Creator
- Distinct
- Destroyer
- Destructor
-
13. A Variable __ of void type.
- May be declared
- Can be initialized
- Cannot be intialized
- Cannot be declared
-
14. When one class inherits from the base class, then the original class is called ?
- derived class
- base class
- sub class
- basic class
-
15. Operator overloading is ?
- giving new meaning to existing c++ operators
- making c++ operators work with objects
- giving c++ operators more than they can handle
- making new c++ operators
-
16. A virtual base class ?
- is qualified as virtual in base class definition.
- do not qualified as virtual in base class definition.
- allows to inherit more than one copy of the base class members.
- strict the path of inheritance.
-
17. A class having no public constructors is
- A public protected class
- A public class
- A protected class
- A private class
-
18. What is default scope for a structure ?
- Private
- Protected
- Public
- None of aobve
-
19. The objects can directly access ?
- Public members
- Private members
- Both of above
- None of above
-
20. The advantage of declaring a virtual function as pure is
?
- programs runs faster
- early binding can be achieved
- you force any derived class to define its own implementation
- you can avoid making the class an abstract class