JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 49
Object Oriented Programming interview questions part 49
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Template classes must have at least one static member.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
2. Which is the pointer which denotes the object calling the member function?
A. Variable pointer
B. This pointer
C. Null pointer
D. Zero pointer
Show Correct Answer
Correct Answer is :
This pointer
3. Which among the following is true?
A. this pointer is passed implicitly when member functions are called
B. this pointer is passed explicitly when member functions are called
C. this pointer is passed with help of pointer member functions are called
D. this pointer is passed with help of void pointer member functions are called
Show Correct Answer
Correct Answer is :
this pointer is passed implicitly when member functions are called
4. The this pointer is accessible __________________
A. Within all the member functions of the class
B. Only within functions returning void
C. Only within non-static functions
D. Within the member functions with zero arguments
Show Correct Answer
Correct Answer is :
Only within non-static functions
5. An object’s this pointer _____________________
A. Isn’t part of class
B. Isn’t part of program
C. Isn’t part of compiler
D. Isn’t part of object itself
Show Correct Answer
Correct Answer is :
Isn’t part of object itself
6. The result of sizeof() function __________________
A. Includes space reserved for this pointer
B. Includes space taken up by the address pointer by this pointer
C. Doesn’t include the space taken by this pointer
D. Doesn’t include space for any data member
Show Correct Answer
Correct Answer is :
Doesn’t include the space taken by this pointer
7. Whenever non-static member functions are called _______________
A. Address of the object is passed implicitly as an argument
B. Address of the object is passed explicitly as an argument
C. Address is specified globally so that the address is not used again
D. Address is specified as return type of the function
Show Correct Answer
Correct Answer is :
Address of the object is passed implicitly as an argument
8. Which is the correct interpretation of the member function call from an object, object.function(parameter);
A. object.function(&this, parameter)
B. object(&function,parameter)
C. function(&object,¶meter)
D. function(&object,parameter)
Show Correct Answer
Correct Answer is :
function(&object,parameter)
9. The address of the object _________________
A. Can’t be accessed from inside the function
B. Can’t be accessed in the program
C. Is available inside the member function using this pointer
D. Can be accessed using the object name inside the member function
Show Correct Answer
Correct Answer is :
Is available inside the member function using this pointer
10. Which among the following is true?
A. This pointer can be used to guard against any kind of reference
B. This pointer can be used to guard against self-reference
C. This pointer can be used to guard from other pointers
D. This pointer can be used to guard from parameter referencing
Show Correct Answer
Correct Answer is :
This pointer can be used to guard against self-reference
11. Which syntax doesn’t execute/is false when executed?
A. if(&object != this)
B. if(&function !=object)
C. this.if(!this)
D. this.function(!this)
Show Correct Answer
Correct Answer is :
if(&object != this)
12. The this pointers _____________________
A. Are modifiable
B. Can be assigned any value
C. Are made variables
D. Are non-modifiable
Show Correct Answer
Correct Answer is :
Are non-modifiable
13. Earlier implementations of C++ ___________________
A. Never allowed assignment to this pointer
B. Allowed no assignment to this pointer
C. Allowed assignments to this pointer
D. Never allowed assignment to any pointer
Show Correct Answer
Correct Answer is :
Allowed assignments to this pointer
14. This pointer can be used directly to ___________
A. To manipulate self-referential data structures
B. To manipulate any reference to pointers to member functions
C. To manipulate class references
D. To manipulate and disable any use of pointers
Show Correct Answer
Correct Answer is :
To manipulate self-referential data structures
15. Which among the following is/are type(s) of this pointer?
A. const
B. volatile
C. const or volatile
D. int
Show Correct Answer
Correct Answer is :
const or volatile
16. Which is the correct syntax for declaring type of this in a member function?
A. classType [cv-qualifier-list] *const this;
B. classType const[cv-qualifier-list] *this;
C. [cv-qualifier-list]*const classType this;
D. [cv-qualifier-list] classType *const this;
Show Correct Answer
Correct Answer is :
[cv-qualifier-list] classType *const this;
17. How many types of constructors are available, in general, in any language?
A. 2
B. 3
C. 4
D. 5
Show Correct Answer
Correct Answer is :
3
18. Choose the correct option for the following code. class student { int marks; } student s1; student s2=2;
A. Object s1 should be passed with argument.
B. Object s2 should not be declared
C. Object s2 will not be created, but program runs
D. Program gives compile time error
Show Correct Answer
Correct Answer is :
Program gives compile time error
19. Which constructor is called while assigning some object with another?
A. Default
B. Parameterized
C. Copy
D. Direct assignment is used
Show Correct Answer
Correct Answer is :
Copy
20. It’s necessary to pass object by reference in copy constructor because:
A. Constructor is not called in pass by reference
B. Constructor is called in pass by reference only
C. It passes the address of new constructor to be created
D. It passes the address of new object to be created
Show Correct Answer
Correct Answer is :
Constructor is not called in pass by reference
Similar Interview Questions
Search for latest jobs
Find Jobs