基于文档:
Compiled code to be executed by the Java virtual machine is represented using a hardware- and operating system-independent binary format, typically (but not necessarily) stored in a file, known as the class file format.
如何理解这一行:通常(但不一定)
。这是什么意思?我可以保存在 my file
或 hello file
之类的文件中,或者什么?
最佳答案
这意味着编译的类通常存储在文件中,但在某些系统中它们可能以其他方式存储(而不是在文件中)。
例如,使用 Oracle 数据库,可以用 Java 编写存储过程。这些存储过程将被编译,但不会保存在类文件中;相反,编译后的类存储在数据库中的某个位置。
关于java - 为什么Java类文件 "typically (but not necessarily)"存储在一个文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9592939/