Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * whether the value in the all-close range [minValue, MaxValue].
     * 
     * @param minValue
     * @param MaxValue
     * @param value
     * @return
     */
    public static boolean isInRange(int minValue, int MaxValue, int value) {
        boolean inRange = false;
        int min = Math.min(minValue, MaxValue);
        int max = Math.max(minValue, MaxValue);
        if (value >= min && (value <= max)) {
            inRange = true;
        }
        return inRange;
    }
}