Created
October 4, 2015 13:36
-
-
Save alblue/6cc55e4a27241dc65a82 to your computer and use it in GitHub Desktop.
Simple testcase to determine if inner classes or lambdas take up more space
This file contains 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
package foo; | |
public class X { | |
public static final Runnable y = new Y(); | |
public static final Runnable z = new Z(); | |
static class Y implements Runnable { | |
@Override | |
public void run() { | |
// TODO Auto-generated method stub | |
System.out.println("Hello world"); | |
} | |
} | |
static class Z implements Runnable { | |
@Override | |
public void run() { | |
// TODO Auto-generated method stub | |
System.out.println("Hello again"); | |
} | |
} | |
} |
This file contains 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
package foo; | |
public class Z { | |
public static final Runnable y = () -> System.out.println("Hello world"); | |
public static final Runnable z = () -> System.out.println("Hello again"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
File sizes for the above:
Inner classes:
Lambdas:
Compiled with 1.8.0_60