Long in Range message - Android java.lang

Android examples for java.lang:long

Description

Long in Range message

Demo Code


//package com.java2s;
import android.util.Log;

public class Main {
    public static void inRange(int value, int start, int end, String message) {
        if (value < start && value > end) {
            Log.d("TTT", "Value : " + value + " | Start : " + start
                    + " | End : " + end);
            throw new IllegalArgumentException(message);
        }/*from  www.j a v  a 2s. com*/
    }

    public static void inRange(int value, int start, int end) {
        inRange(value, start, end, "Not in range!");
    }
}

Related Tutorials