C++ Fundamentals
C++ Fundamentals and Object-Oriented Programming concepts including classes, objects, constructors, destructors, inheritance, operators, and stream I/O
Questions
A static member function can change
- any member of the class instances
- only static members of class instances
- only integer values
- none of the above
Destructor function is called when the object
- goes out of scope
- expires
- both (1) and (2)
- none of the above
Which of the following operators can be overloaded in C++?
- +=
- =
- = =
- All of the above
Default constructor has
- no arguments
- one argument
- two arguments
- an object argument
For class person, destructor would be
- `Person
- ~Person
- :Person
- None of the above
How many types of constructors are possible in C++?
- 1
- 2
- 3
- 4
'ostream.put method' is used to write
- a string
- a char
- an int
- all of the above
How many objects of a class can be instantiated?
- 1
- 5
- 99
- No limit
>> is also called
- extraction operator
- insertion operator
- unary Operator
- binary operator
Structure in C++ can store
- only similar data type
- any data type
- only two data types
- only 5 data types
To set the precision of floating point number, you use
- Cout.prec()
- Cout.precision
- Cout.Precision
- None of the above
Inheritance is used to
- reuse code
- add functionality
- both (1) and (2)
- none of the above
Class Libraries can be used
- to reuse code
- for component based programming
- both (1) and (2)
- none of the above
Class is best described as
- a user defined data type
- a data type
- a template for objects
- all of the above
Objects are used to
- mimic real life cases
- wake at abstract level
- both (1) and (2)
- none of the above
C++ language is a/an
- object oriented language
- structured language
- procedural language
- none of the above
Private data can be inherited.
- True
- False
- Sometimes true
- None of the above
Methods are generally
- private
- public
- protected
- none of the above
Class definition is terminated by
- @
- !
- :
- ;
In C,
- data is secure
- data is insecure
- data is abstract
- none of the above
In C++,
- data is secure
- data is insecure
- data is abstract
- none of the above
The entry point of C++ program is
- the first line of the class
- the main function
- the first executable method of the class
- none of the above
Which of the following is not a C++ keyword?
- asm
- signed
- export
- inline
In argument passing by value,
- same variable is accessed in called function
- new variable is accessed in called function
- new object is created in memory
- both (2) and (3)
Which of the following is not a C++ keyword?
- _cs
- _ss
- _ds
- _cc