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

Code Example 1

// compile
> javac myCode.java
// run
> java myCode

Learn ReactJs, React Native from akashmittal.com