Home > Object Oriented Programming > Quizzes > Object Oriented Programming Practice Test: Default Arguments vs Overloading, Upcasting and Downcasting
Object Oriented Programming Practice Test: Default Arguments vs Overloading, Upcasting and Downcasting
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 66% Most missed: “Which among the following function can be called without arguments?”
Quiz on default arguments, constructors overloading, upcasting and downcasting. In Object-Oriented Programming (OOPs), overloading is a fundamental concept that allows a class to define multiple methods with the same name but different parameters. Function overloading is more general than default arguments because overloaded functions can take different types of parameters.  Here are some differences between default arguments and overloading: Default arguments: A default argument is a value that the compiler inserts if it isn't specified in the function call. Default arguments can only... Show more
Object Oriented Programming Practice Test: Default Arguments vs Overloading, Upcasting and Downcasting
Time left 00:00
25 Questions

1. If a function have all the default arguments but still some values are passed to the function then ______________
2. Which among the following function can be called without arguments?
3. Which among the following is true for upcasting in inheritance?
4. Which is a good alternative instead of having one zero argument constructor and one single argument constructor with default argument?
5. If dynamic_cast fails, which value is returned?
6. What function will be called with the independent syntax “test(5,6,7);”?
7. Which among the following is the best situation to use upcasting?
8. Which among the following is a wrong call to the function void test(int x, int y=0, int z=0)?
9. Which among the following is true for constructors overloading?
10. The using declaration __________
11. Why is downcasting possible in any language?
12. What should be used for safe downcast?
13. How to prevent the ClassCastExceptions?
14. If a constructors should be capable of creating objects without argument and with arguments, which is a good alternative for this purpose?
15. Upcasting and downcasting objects are the same as casting primitive types.
16. Which among the following is correct?
17. What are default arguments?
18. Which property is shown most when upcasting is used?
19. Which among the following is true?
20. Which way the downcasting is possible with respect to inheritance?
21. How many parameters must be passed if only the following prototype is given to a constructor?
Prototype: className(int x, int y, int z=0);
22. Can a class have more than one function with all the default arguments?
23. Upcasting is _____________________ without an explicit type cast.
24. Java supports direct downcasting.
25. Downcasting ____________________