Skip to content

Typos/small errors in Interfaces, Records, and Packages tutorials ( https://dev.java/learn/interfaces/ , https://dev.java/learn/records/ , https://dev.java/learn/packages/ ) #230

@willy-b

Description

@willy-b

Hello dev.java team!

I am writing to report some minor typos/small errors in the Interfaces, Records, and Packages short tutorials ( https://dev.java/learn/interfaces/ , https://dev.java/learn/records/ , https://dev.java/learn/packages/ ) in case the team is interested to rectify them.


In the latest version of the Interfaces short tutorial https://dev.java/learn/interfaces/ (archived as is at https://web.archive.org/web/20260422021726/https://dev.java/learn/interfaces/ ),

The TOC appears to accidentally duplicate a heading description:

  • Interfaces
    Using interfaces to design contracts that spells out how their software interacts.
  • Implementing an Interface
    Using interfaces to design contracts that spells out how their software interacts.
    [exact repeat of "Interfaces" section description (seems unintentional)]
  • Using an Interface as a Type
    An interface defines a type
Image

In the latest version of the Records short tutorial https://dev.java/learn/records/ (archived as is at https://web.archive.org/web/20260421223631/https://dev.java/learn/records/ )

  • In two places, under "Using the Compact Constructor" and "Using the Canonical Constructor",
    throwing an exception if end <= start is described as ensuring "End cannot be lesser than start" when in fact it is ensuring "End cannot be lesser than or equal to the start":

if (end <= start) {
throw new IllegalArgumentException("End cannot be lesser than start");
}

The message should be "End cannot be lesser than or equal to start" or "End must be greater than start".

  • In the sentence,

Having a constructor that does not take any city is useful in your application. This can be another constructor, that only takes the state name and the capital city name.

"does not take any city" seems like it was intended to be "does not take any list of cities"
as the List<String> cities argument is the one that is being omitted in the additional constructor added in this example (while the String capitalCity argument remains).


In the latest version of the Packages short tutorial https://dev.java/learn/packages/ (archived as is at https://web.archive.org/web/20260421231030/https://dev.java/learn/packages/ )

  • In the sentence

Here iss how you would import the Rectangle class from the graphics package created in the previous section.

"Here iss" should be "Here is".


Thanks very much for all the excellent content (which is hardly affected by such issues), it is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions