English

Method prototype for the method compute which accepts two integer arguments and returns true/false. - Computer Applications

Advertisements
Advertisements

Question

Method prototype for the method compute which accepts two integer arguments and returns true/false.

Options

  • void compute (int a, int b)

  • boolean compute (int a, int b)

  • Boolean compute (int a,b)

  • int compute (int a, int b)

MCQ
Advertisements

Solution

boolean compute (int a, int b)

Explanation: 

  • This method prototype correctly defines a method named compute that accepts two integer arguments and returns a boolean value (true or false).
  • The return type boolean Indicates that the method will return a boolean value.
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (March) Specimen Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×