ICSE Class 10 Computer Applications Question 9 of 30

Solved 2024 Question Paper ICSE Class 10 Computer Applications — Question 14

Back to all questions
14
Question

Question 1(xiv)

Method which reverses a given number is:

  1. Impure method
  2. Pure method
  3. Constructor
  4. Destructor
Answer

Pure method

Reason — A pure method in Java is a method that:

  1. Returns a value based only on its input arguments.
  2. Does not modify any external variables or system state.
  3. Does not change any class fields or input values.

In the context of reversing a number, a pure method accepts the number as input and returns its reversed form without altering any external state.