Perl 的 require 命令的 java 等价物是什么?

What is the java equivalent for Perl's require command?

我对 cgi 概念完全陌生。

我接到一个任务,将 Perl cgi 脚本转换为 Java 程序。

我了解到 Perl 中的 require 'file.ext' 命令包含可用于 Perl 脚本中的代码的文件。

由于资源非常有限且文档不当,我找不到任何合适的信息。

是否有任何 Java 等效于执行与 Perl 中的 require 相同的操作?

范式根本没有映射。在 Perl 中,require simply reads a file and runs the code in it, and everything else happens as side effects of that. In Java, your code must be compiled, and classes are included automatically when you compile your program. See Extend a java class from one file in another java file 有关此主题的更多答案。