Skip to content

Instantly share code, notes, and snippets.

@FedericoPonzi
Created March 18, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FedericoPonzi/bfdadb3db622632122be to your computer and use it in GitHub Desktop.
Save FedericoPonzi/bfdadb3db622632122be to your computer and use it in GitHub Desktop.
"High five" in Java.
/**
* 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