Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Last active October 30, 2017 10:53
Show Gist options
  • Save s1monw1/832ea7346136d8003d4aca8511dfeea7 to your computer and use it in GitHub Desktop.
Save s1monw1/832ea7346136d8003d4aca8511dfeea7 to your computer and use it in GitHub Desktop.
public class Overloader {
public static void main(String[] args) {
Overloader o = new Overloader();
o.testWithoutPrint(2);
o.test(2);
}
public void test(int a, boolean printToConsole) {
if (printToConsole) System.out.println("int a: " + a);
}
public void testWithoutPrint(int a) {
test(a, false);
}
public void test(int a) {
test(a, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment