What is the difference between .class and .dex files?(.class 和 .dex 文件有什么区别?)
问题描述
当然,.dex
文件是针对Android的Dalvik VM的,.class
文件是针对JVM的.但我想知道它们是否有相似的布局(常量池、字段、方法、属性……)?字节码不同,但是否存在与 JVM 中的字节码等效的 Dalvik 特定操作码?
Of course, .dex
files are for the Dalvik VM of Android and .class
files are for the JVM. But I wonder if they have similar layouts (Constant Pool, Fields, Methods, Attributes, ...)? The bytecode is different, but are there Dalvik specific opcode equivalents to the ones from the JVM?
推荐答案
Java jar 文件有很多类文件,而每个 APK 文件只有一个classes.dex 文件,如下所示.根据谷歌,APK 格式出于性能和安全原因,与类文件格式不同.
Whereas a Java jar file has many class files, each APK file has only a single classes.dex file, as shown below. According to Google, the APK format differs from the class-file format for performance and security reasons.
这篇关于.class 和 .dex 文件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:.class 和 .dex 文件有什么区别?


- C++ 和 Java 进程之间的共享内存 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01