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