Created
March 18, 2016 18:45
-
-
Save FedericoPonzi/bfdadb3db622632122be to your computer and use it in GitHub Desktop.
"High five" in Java.
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
/** | |
* This method fetches an integer value of five from the top of the call stack, which is as high as you can get | |
* @return a high five | |
*/ | |
public static int five() { | |
try { | |
return five(); | |
} | |
catch (StackOverflowError e) { | |
return 5; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment