Methods
- Which of these is the method which is executed first before execution of any other thing takes place in a program?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
If a static method is present in the program then it will be executed first, then main will be executed.
- What is the process of defining more than one method in a class differentiated by parameters?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Function overloading is a process of defining more than one method in a class with same name differentiated by function signature i:e return type or parameters type and number. Example – int volume(int length, int width) & int volume(int length , int width , int height) can be used to calculate volume.
- Which of these can be used to differentiate two or more methods having same name?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Return type of method, Number of parameters and Parameters data type can be used to differentiate two or more methods having same name.
- What is the process of defining a method in subclass having same name & type signature as a method in its superclass?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Method overriding
- Which of these keyword can be used in subclass to call the constructor of superclass?
-
View Hint View Answer Discuss in Forum
None of these
Correct Option: D
super