Return the minimum of three values. - Java java.lang

Java examples for java.lang:Math Operation

Description

Return the minimum of three values.

Demo Code


//package com.java2s;

public class Main {
    /**/*from   www  .  j a  va2  s.com*/
     * Return the minimum of three values.
     * @param a
     * @param b
     * @param c
     * @return
     */
    public static int min(int a, int b, int c) {
        int low1 = Math.min(a, b);
        int low2 = Math.min(b, c);
        return Math.min(low1, low2);
    }
}

Related Tutorials