Runtime.version()

The standard-library method a running program calls to learn which Java version it is running on.

In more detail

Runtime.version() returns a Runtime.Version object whose feature() method gives the feature release number, such as 21. It lets a program report or check its own platform at runtime. The course uses it to show that the class file version is the feature number plus 44.

Example

Runtime.version().feature()  // 21

Related terms

Taught in

References