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?
APPEARS IN
RELATED QUESTIONS
Write a method prototype name check() which takes an integer argument and returns a char:
The number of values that a method can return is ______.
A method which does not modify the value of variables is termed as ______.
Assertion(A): An argument is a value that is passed to a method when it is called.
Reason(R): Variables which are declared in a method prototype to receive values are called actual parameters.
