Check out example codes for "java version command". It will help you in understanding the concepts better.

Code Example 1

java -version

Code Example 2

java --version

Learn ReactJs, React Native from akashmittal.com