Created
February 23, 2025 07:39
-
-
Save msbaek/50e787abdaaff48ef1e9859cf72d33a9 to your computer and use it in GitHub Desktop.
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
public class Divider { | |
public int divide(int dividend, int divisor) { | |
if (divisor == null) { | |
throw new IllegalArgumentException("divisor must not be null"); | |
} | |
if (dividend == null) { | |
throw new IllegalArgumentException("dividend must not be null"); | |
} | |
if (divisor == 0) { | |
throw new IllegalArgumentException("divisor must not be 0"); | |
} | |
return dividend / divisor; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment