

MCQOPTIONS
Saved Bookmarks
This section includes 20 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
The virtual function overrides ____________ |
A. | Do not acquire base class declaration of default arguments |
B. | Do acquire base class declaration of default arguments |
C. | Do not link with the default arguments of base class |
D. | Do link with the default argument but only of derived classes |
Answer» B. Do acquire base class declaration of default arguments | |
2. |
The default argument get bound during declaration ________________ |
A. | And are never executed |
B. | And are executed simultaneously |
C. | But are executed only if priority is given |
D. | But are executed during function call |
Answer» E. | |
3. |
The names given to the default arguments are only looked up and ________________ and are bound during declaration. |
A. | Checked for availability |
B. | Checked for random access |
C. | Checked for accessibility |
D. | Checked for feasibility |
Answer» D. Checked for feasibility | |
4. |
The using declaration __________ |
A. | Doesn’t carry over the default values |
B. | Carries over the known default arguments |
C. | Carries over only the normal arguments |
D. | Carries over only few default arguments |
Answer» C. Carries over only the normal arguments | |
5. |
The non-template functions can be added with default arguments to already declared functions ____________________ |
A. | If and only if the function is declared again in the same scope |
B. | If and only if the function is declared only once in the same scope |
C. | If and only if the function is declared in different scope |
D. | If and only if the function is declared twice in the program |
Answer» B. If and only if the function is declared only once in the same scope | |
6. |
Which among the following is false for default arguments? |
A. | Those are not allowed with a declaration of pointer to functions |
B. | Those are not allowed with the reference to functions |
C. | Those are not allowed with the typedef declarations |
D. | Those are allowed with pointer and reference to function declaration |
Answer» E. | |
7. |
Default arguments are _________________________ |
A. | Only allowed in the parameter list of the function declaration |
B. | Only allowed in the return type of the function declaration |
C. | Only allowed with the class name definition |
D. | Only allowed with the integer type values |
Answer» B. Only allowed in the return type of the function declaration | |
8. |
Which among the following is a wrong call to the function void test(int x, int y=0, int z=0)? |
A. | test(5,6,7); |
B. | test(5); |
C. | test(); |
D. | test(5,6); |
Answer» D. test(5,6); | |
9. |
What function will be called with the independent syntax “test(5,6,7);”? |
A. | void test(int x, int y) |
B. | void test(int x=0, int y, int z) |
C. | int test(int x=0, y=0, z=0) |
D. | void test(int x, int y, int z=0) |
Answer» E. | |
10. |
Which among the following is correct? |
A. | void test(int x=0, int y, int z=0) |
B. | void test(int x=0, int=0) |
C. | void test(int x, int y=0) |
D. | void test(int x=’c, int y) |
Answer» D. void test(int x=’c, int y) | |
11. |
If a function have all the default arguments but still some values are passed to the function then ______________ |
A. | The function will use the values passed to it |
B. | The function will use the default values as those are local |
C. | The function can use any value whichever is higher |
D. | The function will choose the minimum values |
Answer» B. The function will use the default values as those are local | |
12. |
Which among the following function can be called without arguments? |
A. | void add(int x, int y=0) |
B. | void add(int=0)c) void add(int x=0, int y=0)d) void add(char |
C. | void add(int x=0, int y=0) |
D. | void add(char c) |
Answer» D. void add(char c) | |
13. |
If a member function have to be made both zero argument and parameterized constructor, which among the following can be the best option? |
A. | Two normal and one default argument |
B. | At least one default argument |
C. | Exactly one default argument |
D. | Make all the arguments default |
Answer» E. | |
14. |
Which is the correct condition for the default arguments? |
A. | Those must be declared as last arguments in argument list |
B. | Those must be declared first in the argument list |
C. | Those can be defined anywhere in the argument list |
D. | Those are declared inside the function definition |
Answer» B. Those must be declared first in the argument list | |
15. |
What are default arguments? |
A. | Arguments which are not mandatory to be passed |
B. | Arguments with default value that aren’t mandatory to be passed |
C. | Arguments which are not passed to functions |
D. | Arguments which always take same data value |
Answer» C. Arguments which are not passed to functions | |
16. |
WHICH_AMONG_THE_FOLLOWING_IS_FALSE_FOR_DEFAULT_ARGUMENTS??$ |
A. | Those are not allowed with declaration of pointer to functions |
B. | Those are not allowed with the reference to functions |
C. | Those are not allowed with the typedef declarations |
D. | Those are allowed with pointer and reference to function declaration |
Answer» E. | |
17. |
The using declaration __________$ |
A. | Doesn’t carry over the default values |
B. | Carries over the known default arguments |
C. | Carries over only the normal arguments |
D. | Carries over only few default arguments |
Answer» C. Carries over only the normal arguments | |
18. |
The non-template functions can be added with default arguments to already declared functions ____________________$ |
A. | If and only if the function is declared again in the same scope |
B. | If and only if the function is declared only once in the same scope |
C. | If and only if the function is declared in different scope |
D. | If and only if the function is declared twice in the program |
Answer» B. If and only if the function is declared only once in the same scope | |
19. |
Default arguments are ________________________? |
A. | Only allowed in the parameter list of the function declaration |
B. | Only allowed in the return type of the function declaration |
C. | Only allowed with the class name definition |
D. | Only allowed with the integer type values |
Answer» B. Only allowed in the return type of the function declaration | |
20. |
What function will be called with the independent syntax “test(5,6,7);”?$ |
A. | void test(int x, int y) |
B. | void test(int x=0,int y,int z) |
C. | int test(int x=0,y=0,z=0) |
D. | void test(int x,int y, int z=0) |
Answer» E. | |