Skip to content

Instantly share code, notes, and snippets.

@david-mart
Created April 5, 2018 03:49
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 david-mart/655799f17f6dab354b08913edf6804d9 to your computer and use it in GitHub Desktop.
Save david-mart/655799f17f6dab354b08913edf6804d9 to your computer and use it in GitHub Desktop.
public class MinMethod {
static int getMin(int a, int b) {
if( a < b ) {
return a;
} else {
return b;
}
}
static int getMin3(int x, int y, int z) {
int min = getMin(x, y);
return getMin(min, z);
}
public static void main(String args[]) {
int minimum = getMin3(5,7,3);
System.out.print(minimum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment