import语句字节码的意义 [英] import statement byte code significance

查看:151
本文介绍了import语句字节码的意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说,类中有一些import语句。为该类生成字节代码时,这些import语句会发生什么。

Lets say , there are some import statements in a class. When the byte code is generated for that class, what happens to these import statements.

如果在运行时忽略了import语句,那么在运行时如何解析对该类方法的依赖性。

If the import statements are ignored during runtime, how are the dependencies on that classes methods resolved during runtime.

推荐答案

导入语句的目的只是为了使代码的人类读者(和作者)的生活更轻松。因此,它们被字节码中对完全限定的类/方法名称的引用所取代。未使用的import语句将被忽略。

The purpose of import statements is just to make life easier for the human readers (and authors) of the code. Thus they are replaced by references to the fully qualified class/method names in the bytecode. And unused import statements are ignored.

这篇关于import语句字节码的意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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