Created
September 2, 2022 21:37
-
-
Save s1monw1/c531b46cf2153d869684de73f7a1239d 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 Overloader { | |
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); | |
} | |
public static void main(String[] args) { | |
Overloader o = new Overloader(); | |
o.testWithoutPrint(2); | |
o.test(2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment