← Winnitude! Search  ·  Reader Mode (1531 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 7 LINKS

Mismatched class names in code example and compiler output example · Issue #284 · java/devjava-content

Repository navigation

Mismatched class names in code example and compiler output example  #284


New issue

New issue

Open

Open
Mismatched class names in code example and compiler output example #284

Description

@authentictech's profile authentictech opened on Oct 17, 2026

In Learn Java > Organizing your Application > Modules > Strong Encapsulation (of JDK Internals), Experiments with Strong Encapsulation section, there is a code example which includes the sun.util.BuddhistCalendar class which is different to the sun.util.PreHashedMap class given in the related compiler output, as below:

Code:

// add to `main` method
IO.println(sun.util.BuddhistCalendar.class.getSimpleName());

Compiler output:

Internal.java:8: error: package sun.util is not visible
                IO.println(sun.util.PreHashedMap.class.getSimpleName());
                                      ^
  (package sun.util is declared in module java.base, which does not export it)
1 error
error: compilation failed

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