1(xiv)
Method which reverses a given number is:
- (a)Impure method
- (b)Pure method
- (c)Constructor
- (d)Destructor
Show SolutionHide Solution↓
Pure method
Reason — A pure method in Java is a method that:
- Returns a value based only on its input arguments.
- Does not modify any external variables or system state.
- 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.