Check out example codes for "check java version cmd". 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