All pastes #2103901 Raw Edit

Someone

public text v1 · immutable
#2103901 ·published 2012-01-18 20:33 UTC
rendered paste body
import java.util.*;

public class Test {

	private static Scanner in = new Scanner(System.in);
	private static int inputVal = 0;
	private static boolean isBetween = false;
	
	public static boolean enterInteger(int a, int b) {
		do {
			System.out.print("Enter a value between " + a + " and " + b + " :");
			inputVal = in.nextInt();
		} while(!(inputVal >= a && inputVal <= b));
		return true;
	}
	
	public static void main(String args[]) {
		isBetween = enterInteger(4, 4);
		if(isBetween) {
			System.out.println("Yaaaaaaaaaaaay");
		}
	}
}