Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8130795

Typo in Answer to Questions and Exercises: Generics

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: docs
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            bhoran Bernard Horan
            Reporter:
            rgallard Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: