Program to explain Generic Interfaces in Java
Filed under: Java on 2024-04-13 09:09:43
// Program to explain Generic Interfaces.interface MinMax<T extends Comparable<T>> {T min();T max();}class MyClass<T extends Comparable<T>> implements MinMax<T> {T[ ] vals;MyClass(T[ ] o) { vals = o;}public T min() { T v = vals[0