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

Code typo in Local Classes in tutorial

    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 https://docs.oracle.com/javase/tutorial/java/javaOO/localclasses.html

                  PhoneNumber(String phoneNumber){
                      // numberLength = 7;
                      String currentNumber = phoneNumber.replaceAll(
                        regularExpression, "");
                      if (currentNumber.length() == numberLength)
                          formattedPhoneNumber = currentNumber;
                      else
                          formattedPhoneNumber = null;
                  }

      numberLength = 7 => // numberLength = 10

      Or, better clarify that the code is being changed that correct numbers only have seven digits (the point of this assignment is to demonstrate effectively final variables.


        Attachments

          Activity

            People

            Assignee:
            rgallard Raymond Gallardo
            Reporter:
            rgallard Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: