Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Created October 27, 2017 21:28
Show Gist options
  • Save s1monw1/2274a16c5f441ebabf03c423764b2547 to your computer and use it in GitHub Desktop.
Save s1monw1/2274a16c5f441ebabf03c423764b2547 to your computer and use it in GitHub Desktop.
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