In http://docs.oracle.com/javase/tutorial/java/generics/QandE/generics-answers.html
11. Consider this class:
class Node<T> implements Comparable<T> {
public int compareTo(T obj) { /* ... */ }
// ...
}
Will the following code compile? If not, why?
Answer: Yes.
Node<String> node = new Node<>();
Comparable<String> comp = node;
==============
Move "Answer: Yes." to the end of the item.
11. Consider this class:
class Node<T> implements Comparable<T> {
public int compareTo(T obj) { /* ... */ }
// ...
}
Will the following code compile? If not, why?
Answer: Yes.
Node<String> node = new Node<>();
Comparable<String> comp = node;
==============
Move "Answer: Yes." to the end of the item.