Create a generic class that can compute the average of an array of numbers of any given type.
class Stats<T> { T[] nums; Stats(T[] o) { nums = o; } double average() { double sum = 0.0; for (int i = 0; i < nums.length; i++) sum += nums[i].doubleValue(); // Error!!! return sum / nums.length; } }