for java,
Behold, the power of interfaces! On this homework problem you'llimplement a completely generic version of an algorithm to find themaximum of an array. Unlike in the past, when our algorithm onlyworked for int[] or double[], this version will work on any Javaobjects that are comparable, specifically any Java object thatimplements the Comparable interface. Create a public class namedMax with a single class method named max. max should accept anarray of Objects that implement Comparable and return the maximum.If the array is null or empty, you should return null. You willprobably need to review the documentation for Comparable.