Question: The keyword that is used that the variable can not change state?
- 1. const
- 2. static
- 3. friend
- 4. private
Question: Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 – obj2 to work correctly, if the overloaded – operator must?
- 1. Take two arguments
- 2. Create a named temporary object
- 3. Return a value
- 4. Take four arguments
Question: Which of the following operators always takes no argument if overloaded?
- 1. –
- 2. /
- 3. +
- 4. ++
Question: The main function of scope resolution operator (::) is,?
- 1. To define a data member
- 2. To define an object
- 3. To link the definition of an identifier to its declaration
- 4. All of the above
Question: What is a class?
- 1. A class is a section of computer memory containing objects
- 2. A class is a section of the hard disk reserved for object oriented programs
- 3. A class is the part of an object that contains the variables
- 4. A class is a description of a kind of object
Question: Which one of the following features of OOP is used to derive a class from another?
- 1. Polymorphism
- 2. Data hiding
- 3. Encapsulation
- 4. Inheritance
Question: A C++ class is similar to?
- 1. Structure
- 2. Header file
- 3. Library file
- 4. None of the above
Question: To convert from a user-defined class to a basic type, you would most likely use?
- 1. A built-in conversion operator
- 2. A one-argument constructor
- 3. An overloaded = operator
- 4. A conversion operator that‘s a member of the class
Question: Inheritance is a way to?
- 1. Pass arguments to objects of classes
- 2. Organize data
- 3. Add features to existing classes without rewriting them
- 4. Improve data-hiding and encapsulation
Question: In a flow chart diagram rectangle symbol represents?
- 1. Condition
- 2. Input
- 3. Output
- 4. Process