<i id='r6SsJ'><tr id='r6SsJ'><dt id='r6SsJ'><q id='r6SsJ'><span id='r6SsJ'><b id='r6SsJ'><form id='r6SsJ'><ins id='r6SsJ'></ins><ul id='r6SsJ'></ul><sub id='r6SsJ'></sub></form><legend id='r6SsJ'></legend><bdo id='r6SsJ'><pre id='r6SsJ'><center id='r6SsJ'></center></pre></bdo></b><th id='r6SsJ'></th></span></q></dt></tr></i><div id='r6SsJ'><tfoot id='r6SsJ'></tfoot><dl id='r6SsJ'><fieldset id='r6SsJ'></fieldset></dl></div>
    <legend id='r6SsJ'><style id='r6SsJ'><dir id='r6SsJ'><q id='r6SsJ'></q></dir></style></legend>
    1. <small id='r6SsJ'></small><noframes id='r6SsJ'>

    2. <tfoot id='r6SsJ'></tfoot>
      • <bdo id='r6SsJ'></bdo><ul id='r6SsJ'></ul>

      1. 在Android中编译java文件后的注释会发生什么?

        What happens to comments after the java files are compiled in Android?(在Android中编译java文件后的注释会发生什么?)
        <i id='6KM0G'><tr id='6KM0G'><dt id='6KM0G'><q id='6KM0G'><span id='6KM0G'><b id='6KM0G'><form id='6KM0G'><ins id='6KM0G'></ins><ul id='6KM0G'></ul><sub id='6KM0G'></sub></form><legend id='6KM0G'></legend><bdo id='6KM0G'><pre id='6KM0G'><center id='6KM0G'></center></pre></bdo></b><th id='6KM0G'></th></span></q></dt></tr></i><div id='6KM0G'><tfoot id='6KM0G'></tfoot><dl id='6KM0G'><fieldset id='6KM0G'></fieldset></dl></div>
          <tbody id='6KM0G'></tbody>

          1. <tfoot id='6KM0G'></tfoot>
                <bdo id='6KM0G'></bdo><ul id='6KM0G'></ul>
              • <legend id='6KM0G'><style id='6KM0G'><dir id='6KM0G'><q id='6KM0G'></q></dir></style></legend>

                  <small id='6KM0G'></small><noframes id='6KM0G'>

                1. 本文介绍了在Android中编译java文件后的注释会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Android 编译器是如何工作的?编译时会去掉 Java 代码和 Android XML 文件中的注释吗?

                  How does the Android compiler work? Does it remove the comments in Java code and Android XML files on compilation?

                  推荐答案

                  Java 文件中的注释在编译成类文件时会被删除或忽略.类文件不是供人类阅读的——它们经过优化以在虚拟机上高效运行.如果要保留注释,它们只会导致类文件大于所需的大小,并且没有额外的好处(即编译器和虚拟机不理解注释,所以为什么要包含它们)

                  Comments in Java files are removed, or ignored, when they are compiled into class files. Class files are not for human-reading - they are optimized to run efficiently on a virtual machine. If the comments were to remain, they would just cause the class files to be larger than required, and for no additional benefit (ie, the compiler and virtual machines don't understand comments, so why include them)

                  对于 XML 文件,通常会保留注释.编译后的类文件只有一个用途(在虚拟机上运行),而 XML 文件可以用于多种用途.例如,您可以将 XML 文件加载到应用程序中并对其进行操作.根据应用程序中 XML 文件的使用情况,可能需要在其中保留注释 - 事实上,您的应用程序可能会专门寻找注释.因为 XML 文件可以有广泛的用途,所以不会从 XML 文件中删除注释,以防它们被用于其他目的.

                  As for XML files, the comments are usually retained. Whereas a compiled class file only has 1 purpose (to run on a virtual machine), an XML file could serve many purposes. For example, you can load an XML file into your application and manipulate it. Depending on the use of the XML file in your application, it might be required to keep the comments in there - in fact, your application might specifically look for comments. Because XML files could have a wide range of uses, the comments aren't removed from XML files in case they are required for some other purpose.

                  这篇关于在Android中编译java文件后的注释会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Compiling C++ for the JVM(为 JVM 编译 C++)
                  Compile to java bytecode (without using Java)(编译成java字节码(不使用Java))
                  How to drive C#, C++ or Java compiler to compute 1+2+3+...+1000 at compile time?(如何在编译时驱动 C#、C++ 或 Java 编译器计算 1+2+3+...+1000?)
                  Java ClassLoader: load same class twice(Java ClassLoader:两次加载相同的类)
                  How to debug .class files in ECLIPSE?(如何在 ECLIPSE 中调试 .class 文件?)
                  Java quot;The blank final field may not have been initializedquot; Anonymous Interface vs Lambda Expression(Java“可能尚未初始化空白的最终字段匿名接口与 Lambda 表达式)

                  <legend id='XNk71'><style id='XNk71'><dir id='XNk71'><q id='XNk71'></q></dir></style></legend>

                2. <i id='XNk71'><tr id='XNk71'><dt id='XNk71'><q id='XNk71'><span id='XNk71'><b id='XNk71'><form id='XNk71'><ins id='XNk71'></ins><ul id='XNk71'></ul><sub id='XNk71'></sub></form><legend id='XNk71'></legend><bdo id='XNk71'><pre id='XNk71'><center id='XNk71'></center></pre></bdo></b><th id='XNk71'></th></span></q></dt></tr></i><div id='XNk71'><tfoot id='XNk71'></tfoot><dl id='XNk71'><fieldset id='XNk71'></fieldset></dl></div>

                            <bdo id='XNk71'></bdo><ul id='XNk71'></ul>
                              <tbody id='XNk71'></tbody>

                          • <tfoot id='XNk71'></tfoot>

                            <small id='XNk71'></small><noframes id='XNk71'>