Typo in Answer to Questions and Exercises: Generics

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: docs
    • None

      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.

            Assignee:
            Bernard Horan (Inactive)
            Reporter:
            Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: