In the following method prototype to accept a character, an integer and return YES or NO, fill in the blank to complete the method prototype.

ICSE Class 10 Computer Applications PYQ · 2026 Paper · Section A

1(x)1 Mark · 2026 · Section A · 2026 Paper

In the following method prototype to accept a character, an integer and return YES or NO, fill in the blank to complete the method prototype.

public ............... someMethod(char ch, int n)

Show SolutionHide Solution↓

String

Reason — The method is required to return "YES" or "NO", which are textual values. In Java, such values are represented using the String data type. Hence, the return type of the method should be String, not boolean, int, or double.

The complete method prototype:

public String someMethod(char ch, int n)

← Previous questionNext question →

Browse the free Computer Applications sample bank