java命令运行包中的java文件(The Java command runs the java files in the package)

假设src目录下有Printer.java文件

Printer类处于test包下

运行过程:

1. 进入src目录  然后javac -d . Printer.java

2.java test.Printer   如果直接用java Printer会找不到Printer类

————————

Suppose there is a printer in the SRC directory Java file

The printer class is under the test package

Operation process:

1. Enter the SRC directory, and then javac – D Printer. java

2.java test. Printer} if you directly use Java printer, the printer class will not be found