KnowledgeBoat Logo
|

Computer Applications

Which statement is correct for the method prototype given below:

int check(char ch, String s)

  1. check() does not return any value
  2. check() has return type int
  3. check method has two actual parameters
  4. check() is a constructor

User Defined Methods

9 Likes

Answer

check() has return type int

Reason — In the method prototype int check(char ch, String s), the keyword int before the method name specifies that the method returns an integer value. The parameters char ch and String s are formal parameters, and the method is not a constructor as it has a return type.

Answered By

5 Likes


Related Questions