JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 18
Object Oriented Programming interview questions part 18
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the sequence of destructors call?
A. Same order as that of the constructors call
B. Random order
C. According to the priority
D. Revere of the order of constructor call
Show Correct Answer
Correct Answer is :
Revere of the order of constructor call
2. The destructors _____________________
A. Can have maximum one argument
B. Can’t have any argument
C. Can have more than one argument
D. Can’t have more than 3 arguments
Show Correct Answer
Correct Answer is :
Can’t have any argument
3. Destructor calls ________________ (C++)
A. Are only implicit
B. Are only explicit
C. Can be implicit or explicit
D. Are made at end of program only
Show Correct Answer
Correct Answer is :
Can be implicit or explicit
4. Number of destructors called are
A. Always equal to number of constructors called
B. Always less than the number of constructors called
C. Always greater than the number of constructors called
D. Always less than or equal to number of constructors
Show Correct Answer
Correct Answer is :
Always equal to number of constructors called
5. For explicit call _________________
A. The destructor must be private
B. The destructor must be public
C. The destructor must be protected
D. The destructor must be defined outside the class
Show Correct Answer
Correct Answer is :
The destructor must be public
6. If a class have 4 constructors then it must have 4 destructors also.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
7. Which among the following is true for destructors?
A. Destructors can be overloaded
B. Destructors can be define more than one time
C. Destructors can’t be overloaded
D. Destructors are overloaded in derived classes
Show Correct Answer
Correct Answer is :
Destructors can’t be overloaded
8. The constructor _____________
A. Have a return type
B. May have a return type
C. Of derived classes have return type
D. Doesn’t have a return type
Show Correct Answer
Correct Answer is :
Doesn’t have a return type
9. The destructors ____________
A. Have a return type
B. May have a return type
C. Of derived classes have return type
D. Doesn’t have a return type
Show Correct Answer
Correct Answer is :
Doesn’t have a return type
10. The destructor can be called before the constructor if required. (True/False)
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
11. What is extern variable?
A. Variables to be used that are declared in another object file
B. Variables to be used that are declared in another source file
C. Variables to be used that are declared in another executable file
D. Variables to be used that are declared in another program
Show Correct Answer
Correct Answer is :
Variables to be used that are declared in another source file
12. Which among the following is a correct statement for variables?
A. Variable can be declared many times
B. Variable can be declared only one time
C. Variable declaration can’t be done more than ones
D. Variable declaration is always done more than one time
Show Correct Answer
Correct Answer is :
Variable can be declared many times
13. Which among the following is true for the variables?
A. Variable can be defined only once
B. Variable can be defined any number of times
C. Variable must be defined more than one time
D. Variable can be defined in different files
Show Correct Answer
Correct Answer is :
Variable can be defined only once
14. To use extern variable _____________________
A. The source file must not be included in the new file code
B. The source file itself must be used for new program
C. The source file must be included in the new file
D. The source file doesn’t matter for extern variables
Show Correct Answer
Correct Answer is :
The source file must be included in the new file
15. What does a header file contain for an extern variable?
A. Only declaration of variables
B. Only definition of variables
C. Both declaration and definition of variables
D. Neither declaration nor definition
Show Correct Answer
Correct Answer is :
Only declaration of variables
16. Which condition is true if extern variable is used in a file?
A. All the header files declare it
B. Only few required files declare it
C. All header files declared it if required
D. Only one header file should declare it
Show Correct Answer
Correct Answer is :
Only one header file should declare it
17. Whenever a function is declared in a program _____________________
A. extern can be used only in some special cases
B. extern can’t be used
C. function is extern by default
D. it can’t be made extern
Show Correct Answer
Correct Answer is :
function is extern by default
18. Which of the following results in allocation of memory for the extern variables?
A. Declaration
B. Definition
C. Including file
D. Memory is not allocated for extern variables
Show Correct Answer
Correct Answer is :
Definition
19. Which is the correct syntax for extern variable declaration?
A. extern data_type variable_name;
B. extern variable_name;
C. data_type variable_name extern;
D. extern (data_type)variable_name;
Show Correct Answer
Correct Answer is :
extern data_type variable_name;
20. Which is the correct syntax for extern function declaration?
A. extern function_name(argument_list);
B. extern return_type function_name(argument_list);
C. extern (return_type)function_name(argument_list);
D. return_type extern function_name(argument_list);
Show Correct Answer
Correct Answer is :
extern return_type function_name(argument_list);
Similar Interview Questions
Search for latest jobs
Find Jobs