MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER

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

Question ID
#24265
Subchapter
ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A void compute (int a, int b)
  • B boolean compute (int a, int b)
  • C Boolean compute (int a,b)
  • D int compute (int a, int b)
Correct Answer: C

Explanation

Requirement:

  • Method name: compute

  • Accepts two integer arguments(int a, int b)

  • Returns true/false → the return type should be boolean


Step 1: Check options

(a) void compute(int a, int b) → ❌ void means no return value

(b) boolean compute(int a, int b) → ✅ Correct, returns a primitive boolean

(c) Boolean compute(int a, int b) → ✅ Technically correct too, returns wrapper class Boolean, but usually we use boolean for primitives

(d) int compute(int a, int b) → ❌ Returns integer, not true/false


Best Answer: (b) boolean compute(int a, int b)

Note: Option (c) is technically valid but primitive boolean is standard for such cases.

Share This Question

Share this MCQ with your friends or study group.