Check out example codes for "compile java to jar in mac". It will help you in understanding the concepts better.

Code Example 1

javac HelloWorld.java

Learn ReactJs, React Native from akashmittal.com