Java虚拟机 [英] Java Virtual Machine

查看:119
本文介绍了Java虚拟机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用解释器,所有Java程序都被编译为称为字节代码的中间级别。



如果是这样,是不是解释器不是逐行执行输入?为什么输出是字节代码

Using an interpreter, all Java programs are compiled to an intermediate level called byte code.

If this is so, is it not that an interpreter executes the input line by line? And why is that the output is a byte code

推荐答案

它只是将复杂指令简化为更简单的指令。字节码(就像汇编一样)是一组固定的固定指令。这意味着您可以创建一个字节码编译器/解释器,可以执行更新的Java代码而无需更改它。您可以向java核心添加额外的功能,并且仍然能够正常运行它,因为字节码的输出与它兼容。就像将新功能添加到编程语言中一样,无需每次都购买新的处理器。有更多优点,但互联网上有很多优点。所以请试试谷歌。



祝你好运!
It is just reducing complex instructions into smaller simple instructions. The bytecode (just like assembly) is a solid fixed set of instructions. This means that you can create a bytecode compiler/interpreter that can execute newer java code without needing to change it. You can add extra functionality to the java core, and still be able to run it as normal because the output of bytecode is compatible with it. Just like new features are added to programming languages without the need to buy a new processor every time that happens. There are more advantages, but there is a lot on internet about it. So have a try with google.

Good luck!


这篇关于Java虚拟机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆