I have to solve an exercise in which they ask me to make an interface, the statement is as follows:
Construct an ArrayReals class that declares an attribute of type double [] and that implements an interface called Statistics. Content this interface is the following:
- A minimum called method that returns the smallest value in the array.
- A method called maximum that returns the largest value in the array.
- A method called summation that returns the sum of all elements in the array.
Within the interface, at the time of creating the corresponding methods I do not know what code to put, that is, when I am asked to, for example, the interface have to return the smallest value of the ArrayList, how do I do it? In theory, the ArrayList is in one class and the interface in another.
Thanks and regards.