Methods


  1. Which of these is the method which is executed first before execution of any other thing takes place in a program?











  1. 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.


  1. What is the process of defining more than one method in a class differentiated by parameters?











  1. 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.



  1. Which of these can be used to differentiate two or more methods having same name?











  1. 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.


  1. What is the process of defining a method in subclass having same name & type signature as a method in its superclass?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Method overriding



  1. Which of these keyword can be used in subclass to call the constructor of superclass?











  1. View Hint View Answer Discuss in Forum

    None of these

    Correct Option: D

    super