SCJP

only use the command line for test, please observe

1. package

testspace/a/P.java

package a;
public class P {
    public void show() {
        System.out.println("hello world");
    }
}

 

testspace/b/T.java

package b;
import a.P;
public class T{
	public static void main(String args[]) {
		P p = new P();
		p.show();
	}
}

KeyPoint: how to pass the compile

in the testspace folder

E:\testspace>javac b\ T.java

run

E:\testspace>java b. T

你可能感兴趣的:(java)