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




1. 进入src目录  然后javac -d . 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 test. Printer} if you directly use Java printer, the printer class will not be found