<tfoot id='yDATg'></tfoot>

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

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

    • <bdo id='yDATg'></bdo><ul id='yDATg'></ul>
    <legend id='yDATg'><style id='yDATg'><dir id='yDATg'><q id='yDATg'></q></dir></style></legend>

    1. 为什么带有内部类的 Java 代码会生成第三个 SomeClass$1.class 文件?

      Why does Java code with an inner class generates a third SomeClass$1.class file?(为什么带有内部类的 Java 代码会生成第三个 SomeClass$1.class 文件?)

      <tfoot id='mtNLE'></tfoot>
      • <bdo id='mtNLE'></bdo><ul id='mtNLE'></ul>
          <tbody id='mtNLE'></tbody>

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

            <legend id='mtNLE'><style id='mtNLE'><dir id='mtNLE'><q id='mtNLE'></q></dir></style></legend>
            • <i id='mtNLE'><tr id='mtNLE'><dt id='mtNLE'><q id='mtNLE'><span id='mtNLE'><b id='mtNLE'><form id='mtNLE'><ins id='mtNLE'></ins><ul id='mtNLE'></ul><sub id='mtNLE'></sub></form><legend id='mtNLE'></legend><bdo id='mtNLE'><pre id='mtNLE'><center id='mtNLE'></center></pre></bdo></b><th id='mtNLE'></th></span></q></dt></tr></i><div id='mtNLE'><tfoot id='mtNLE'></tfoot><dl id='mtNLE'><fieldset id='mtNLE'></fieldset></dl></div>

                本文介绍了为什么带有内部类的 Java 代码会生成第三个 SomeClass$1.class 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                如果我有一个内部类,像这样:

                If I have an inner class, like this:

                public class Test
                {
                    public class Inner
                    {
                        // code ...
                    }
                
                    public static void main(String[] args)
                    {
                        // code ...
                    }
                }
                

                当我编译它时,我希望它应该生成两个文件:

                When I compile it, I expect it should generate two files:

                Test.class
                Test$Inner.class
                

                那么为什么我有时会看到像 SomeClass$1.class 这样的类文件,即使 SomeClass 不包含名为1"的内部类?

                So why do I sometimes see classfiles like SomeClass$1.class, even though SomeClass does not contain an inner class called "1"?

                推荐答案

                SomeClass$1.class 代表匿名内部类

                The SomeClass$1.class represent anonymous inner class

                看看匿名内部类部分这里

                这篇关于为什么带有内部类的 Java 代码会生成第三个 SomeClass$1.class 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

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

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

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

                            <tbody id='NZQi5'></tbody>
                          <tfoot id='NZQi5'></tfoot>