---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 17 Edition"
java_version: 17
chapter: "Chapter 13. Binary Compatibility"
section: "13.4.3"
heading: "13.4.3. public Classes"
parent: "13.4. Evolution of Classes"
source: https://docs.oracle.com/javase/specs/jls/se17/html/jls-13.html#jls-13.4.3
id: "13.4.3"
url: https://jvm.obfuscated.software/jls/se17/13.4.3.html
raw: https://jvm.obfuscated.software/jls/se17/13.4.3.md
---

# 13.4.3. `public` Classes

Changing a class that is not declared `public` to be declared `public` does not break compatibility with pre-existing binaries.

If a class that was declared `public` is changed to not be declared `public`, then an `IllegalAccessError` is thrown if a pre-existing binary is linked that needs but no longer has access to the class type; such a change is not recommended for widely distributed classes.
