In Java, a \'static method\' would look like this:
class MyUtils { . . . public static double mean(int[] p) { int sum = 0; // sum of all the
Anders' answer is correct, however for utility methods like mean you don't need to use a class, you can put the method in a module:
mean
module MyUtils def self.mean(values) # implementation goes here end end
The method would be called in the same way:
avg = MyUtils.mean([1,2,3,4,5])