Take a look at this piece of code:
public class Application<T> {
public static void main(String[] args) {
Application<Number> application = new Application<>();
Number n1 = application.typeBoundsTest(Integer.valueOf(10));
Number n2 = application.typeBoundsTest(Double.valueOf(1.0));
System.out.println(String.format("%s %s", n1, n2));
}
public <T1 extends T> T typeBoundsTest(T1 item) {
return item;
}
}
What will be the result of its compilation and execution?
Note, that both Integer and Double (as well as some other wrapper classes like Float, Long, etc.) are subclasses of an abstract class Number.