Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the formal specification for java.lang?

There are JLS (and JVMS) defining the "core" java. There are also a lot of JSRs extending its functionality. But is there a specifications for Java's standard library like java.lang?

The closest I found is Java™ Platform, Standard Edition 8 API Specification, but it feels more like documentation rather than specification. Is this doc the official spec for java standard library APIs? Do vendors other than oracle (like AdoptOpenJdk, etc) read this doc-like spec and implement their version of JRE? Or there is another more "formal/official" spec?

like image 577
wlnirvana Avatar asked May 17 '20 09:05

wlnirvana


Video Answer


1 Answers

Yes, the Java Doc comments define the official API specification, as per their statement:

Our documentation comments define the official Java Platform API Specification

There is no other "more official" documentation for the Java API. They elaborate more on using Java Docs as specification in the linked article:

There are commonly two different ways to write doc comments -- as API specifications, or as programming guide documentation. These two targets are described in the following sections. A staff with generous resources can afford to blend both into the same documentation (properly "chunked"); however, our priorities dictate that we give prime focus to writing API specifications in doc comments. This is why developers often need to turn to other documents, such as Java SE Technical Documentation and The Java Tutorials for programming guides

like image 87
Vince Avatar answered Oct 06 '22 16:10

Vince