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 文件有什么区别?


基础教程推荐
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 从 python 访问 JVM 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01