Created
October 27, 2017 21:28
-
-
Save s1monw1/2274a16c5f441ebabf03c423764b2547 to your computer and use it in GitHub Desktop.
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
public class MultiReturn { | |
public static void main(String[] args) { | |
new MultiReturn().useMulti(); | |
} | |
public void useMulti() { | |
Multi multi = helper(); | |
System.out.println("Multi with " + multi.count + " and " + multi.name); | |
} | |
private Multi helper() { | |
return new Multi(2, "test"); | |
} | |
private static class Multi { | |
private final int count; | |
private final String name; | |
public Multi(int count, String name) { | |
this.count = count; | |
this.name = name; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment