compile java file with package in cmd code example
Example 1: cmd java compile
javac MyFisrtProgam.java // enter to compile
java MyfirstProgram // run program
Example 2: how to compile and run java package program
/* File name : Animal.java */
package animals;
interface Animal {
public void eat();
public void travel();
}