import java.util.Arrays;
class Generic<T extends Number> {
private T arr[] = {1, 2, 3, 4, 5};
public String toString(){
return Arrays.toString(arr);
}
}
public class Test {
public static void main(String [] args) {
Generic<Double> obj = new Generic<Double>();
System.out.println(obj);
}
}
Login in to like
Login in to comment