1) Inline functions may not work ______ . 1. If function contain static variables. 2. If function contain global and register variables. 3. If function returning value consists looping construct(i.e. for, while). 4. If inline functions are recursive. 5. If function contains const value. a. Only 1,4,5 b. Only 2,3,5 c. Only 1,3,4 d. All of these
|
||||
2) Which of the followings is/are not false about friend function ? 1. It can be called / invoked with class object. 2. It has objects as arguments. 3. It can have built-in types as arguments. 4. It must declared only in public part of a class. 5. It does not have this pointer as an argument. a. Only 2,4 b. Only 1,2,5 c. Only 2,3,5 d. All of these
|
||||
3) Default return type of functions in CPP is ____ . a. void b. long c. char d. Int
|
||||
4) Default values for a function are need to be specified from left to right only. a. True b. False
|
||||
5) During a class inheritance in CPP, if the visibility mode or mode of derivation is not provided, then by default visibility mode is ___________. a. public b. protected c. private d. Friend
|
||||
6) The derivation of Child class from Base class is indicated by ____ symbol. a. :: b. : c. ; d. |
|
||||
7) If we have object from fstream class, then what is the default mode of opening the file? a. ios::in|ios::out b. ios::in|ios::out|ios::trunc c. ios::in|ios::trunc d. Default mode depends on compiler
|
||||
8) __________ is return type of is_open() function. a. int b. bool c. float d. char *
|
||||
9) Public data members and member functions of the class are accessible ONLY to the member functions of that class. a. True b. False
|
||||
10) Only functions of the class can access the data of the class and they(functions) provides the interface between data, objects and the program. This kind isolation of the data from direct access by the program is called _______________ . a. Data Abstraction b. Data Hiding c. Data Binding d. Data Encapsulation
|
||||
11) A Constructor that does not have any parameters is called____________ Constructor. a. Custom b. Dynamic c. Static d. Default
|
||||
12) If we have object from ofstream class, then default mode of opening the file is _____ . a. ios::in b. ios::out c. ios::in|ios::trunc d. ios::out|ios::trunk
|
||||
13) _______________ is a member function that is declared within a base class and redefined by derived class. a. virtual function b. static function c. friend function d. const member function
|
||||
14) Syntax for Pure Virtual Function is ______________ . a. virtual void show()==0 b. void virtual show()==0 c. virtual void show()=0 d. void virtual show()=0
|
||||
15) Logical expressions produce ____________ type results. a. explicit b. garbage c. bool d. static
|
||||
16) We can initialize a value of static variable of a class only when its object is created. No other initialization is permitted. a. True b. False
|
||||
17) When a base class is privately inherited by the derived class, then_____________ . a. protected members of the base class become private members of derived class b. public members of the base class become private members of derived class c. both a and b d. only b
|
||||
18) What is the difference between protected and private access specifiers in inheritance? a. private member is not inheritable and not accessible in derived class. b. protected member is inheritable and also accessible in derived class. c. Both are inheritable but private is accessible in the derived class. d. Both are inheritable but protected is not accessible in the derived class.
|
||||
19) A friend function does not have 'this' pointer associated with it. a. True b. False
|
||||
20) In nested try blocks, if both inner and outer catch handlers are not able to handle the exception, then ______________ . a. Compiler executes only executable statements of main(). b. Compiler issues compile time errors about it. c. Program will be executed without any interrupt. d. Program will be terminated abnormally.
|