Created
March 21, 2018 06:57
-
-
Save mdstoy/10256f5d77c79183d1f5df651a43deae to your computer and use it in GitHub Desktop.
当たり前だけど、クラスファイルは二つできてしまいますね。1 java ファイル に対して 1 class ファイルが義務付けられる現場の方はご愁傷さまでした。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ javac VarAnonymousClass.java | |
$ ls -1 | |
VarAnonymousClass$1.class | |
VarAnonymousClass.class | |
VarAnonymousClass.java | |
$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VarAnonymousClass{ | |
public static void main (String[] args) { | |
var obj = new Object(){ | |
int value() { | |
return 1; | |
} | |
}; | |
System.out.println(obj.value()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment