Typo in "Object as a Superclass"

XMLWordPrintable

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

      Typo in http://docs.oracle.com/javase/tutorial/java/IandI/objectclass.html

      Replace

      public class Book {
          ...
          public boolean equals(Object obj) {
              if (obj instanceof Book)
                  return ISBN.equals((Book)obj.getISBN());
              else
                  return false;
          }
      }

      with

      public class Book {
      String ISBN;
      public String getISBN() { return ISBN; }
          public boolean equals(Object obj) {
              if (obj instanceof Book)
                  return ISBN.equals(((Book) obj).getISBN());
              else
                  return false;
          }
      }

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

              Created:
              Updated:
              Resolved: