Why write a method that does not operate on an object?
Common reason: encapsulate some computation that involves only numbers.
Numbers aren't objects, you can't invoke methods on them. E.g., x.sqrt()
can never be legal in Java
public class Financial { public static double percentOf(double p, double a) { return (p / 100) * a; } // More financial methods can be added here. }
Call with class name instead of object: double tax = Financial.percentOf(taxRate,
total);