×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Ladislav Mejzlík
Added: Sep 21, 2015 1:22 PM
Modified: Sep 21, 2015 1:35 PM
Views: 9
  1. public static int limit(int number, int min, int max) {
  2.         if (number < min) {
  3.             return min;
  4.         } else if (number > max) {
  5.             return max;
  6.         } else {
  7.             return number;
  8.         }
  9.     }