关于java的5个问题

发布于 2024-11-05 09:10:10 字数 236 浏览 3 评论 0原文

1) javac.exe 是 sun 的 java 编译器实现吗?

2) java 编译器被定义为将 java 源代码转换为 java 字节码的东西,

3) JVM 被定义为接受 java 字节码的东西输入并实际告诉机器做事。

4)并且有许多不同种类的JVM,实际上不同的操作系统需要不同的JVM,

5)并且在windows 98上运行的JVM与在windows 7上运行的JVM不同?

1) Is it true that javac.exe is sun's implementation of a java compiler,

2) and a java compiler is defined as something that translates java source code into java bytecode,

3) and a JVM is defined as something that accepts java bytecode as input and actually tells the machine to do things.

4) and there are many different kinds of JVM, in fact different operating systems Require different JVMs,

5) and the JVM which runs on windows 98 is different from the JVM which runs on windows 7?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

淡紫姑娘! 2024-11-12 09:10:10

是的。 (JVM = Java“虚拟”机)

Yup. (JVM = Java 'Virtual' Machine)

花想c 2024-11-12 09:10:10
  1. 是的
  2. 是的

而且它不允许我发布两个以上的链接,无论如何,简单的搜索会比在这里等待回复更快地产生更多信息。

  1. Yes.
  2. Yes.

And it wouldn't let me post more than two links, anyhow, a simple search would yield a lot more information faster than waiting for replies here.

冷弦 2024-11-12 09:10:10

我认为你问这些问题是为了帮助你理解JAVA的一些基本概念,所以我们不要挖得太深,考虑一下这里的许多“例外”。

1)Sun的编译器实现通常称为javac.exe,但其他编译器也可能将其可执行文件命名为javac.exe(我认为c意味着编译器)。

2) 还有更多内容,但这总体上是正确的

3) 这并不完全错误。不同的 JVM 可能有不同的实现,但 JVM 的想法是将(假定的)通用字节码转换为可以在该特定计算机上执行的机器/操作系统特定的代码。

4)基本正确。只是我们对“不同操作系统”的定义有点宽松。一些操作系统共享相同的体系结构,并且可以使用相同的 JVM。同一操作系统也可以有不同的 JVM 实现。

5) 我相信这是真的。

I would take it that you're asking these questions to help you understand some of the basic concepts of JAVA, so let's not dig too deep and consider the many "exceptions" here.

1) Sun's implementation of the compiler is usually called javac.exe, but other compilers may name their executables javac.exe as well (I think c means compiler).

2) There's much more to it, but this in general is correct

3) That's not completely incorrect. Different JVMs may have different implementations, but the idea of the JVM is to translate the (supposedly) universal bytecode to machine/OS-specific code that can be executed on that particular computer.

4) Largely correct. Except we're defining "different OS" a little loosely. Some OSs share the same architecture, and they can use the same JVM. There can also be different JVM implementations for the same OS.

5) That I believe is true.

吃兔兔 2024-11-12 09:10:10

1)javac.exe是sun的java编译器实现吗?
- 这取决于,因为任何公司/开发人员都可以按照 JVM 规范分发 Java 编译器。

2)java编译器被定义为将java源代码翻译成java字节码的东西,
- 是的,它将源代码编译为字节码

3) 并且 JVM 被定义为接受 java 字节码作为输入并实际告诉机器执行操作的东西。
- 是的

4) 并且有许多不同种类的 JVM,实际上不同的操作系统需要不同的 JVM,
- 正确,对于每个操作系统,它应该有自己的 JVM 实现,您不能在 Linux

5 上运行 Windows 的 JVM,并且在 Windows 98 上运行的 JVM 与在 Windows 7 上运行的 JVM 不同?
- 是

除了您的问题 2、3、4、5 之外,编译器还将源代码转换为 JVM 实现的字节码,以便理解 JVM 在何处运行。

1) Is it true that javac.exe is sun's implementation of a java compiler,
- it depends, as any company / developer can distribute a Java compiler following the JVM spec.

2) and a java compiler is defined as something that translates java source code into java bytecode,
- Yes it compiles source code into byte code

3) and a JVM is defined as something that accepts java bytecode as input and actually tells the machine to do things.
- Yes

4) and there are many different kinds of JVM, in fact different operating systems Require different JVMs,
- Correct, for each OS it should have its own implementation of the JVM, you cannot run a JVM for Windows on Linux

5) and the JVM which runs on windows 98 is different from the JVM which runs on windows 7?
- Yes

In addition to your questions 2,3,4,5, the compiler transforms source code into bytecode for a JVM implementation to understand regardless where that JVM is running on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文