Created
May 26, 2017 09:53
-
-
Save delor/c7bac3351176f7d8e0d4b5aea20d60b7 to your computer and use it in GitHub Desktop.
You don't need to use new keyword anymore. ;)
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
package example; | |
public class Example { | |
private final int a; | |
private Example(int a) { | |
this.a = a; | |
} | |
public static Example Example(int a) { | |
return new Example(a); | |
} | |
public static void main(String[] args) { | |
Example example = Example(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment