Hi Ranchers,
I have taken this question from Master Exam software.
class Food {}
class
Fruit extends Food {}
class Apple extends Fruit {}
//insert code here
public static void main(
String[] munch) {
Pie<Fruit> p = new Pie<Fruit>();
}
}
Given the answers which will compile
A)class Pie<T extends Food> {
B)class Pie<T extends Fruit> {
C)class Pie<T extends Apple> {
D)class Pie<T extends Pie> {
E)class Pie<T super Apple> {
F)class Pie<T> {
The answers are A B and F
Can somebody why A B F correct and why not E is wrong ?
Especially I want to learn why E is wrong ?
