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 文件有什么区别?
基础教程推荐
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01