Write programs on packages and importing.

// Create a a folder in c drive and then file "Hello.java": C:/expack/Hello.java
package expack;
public class Hello {
    public void say() { 
		System.out.println("Hello from package"); 
	}
}

// created a file in C drive: C:/Test.java
import expack.Hello;
class Test {
    public static void main(String[] args) {
        new Hello().say();
    }
}