Java Number Max Value max3(int a, int b, int c)

Here you can find the source of max3(int a, int b, int c)

Description

Returns the maximum of the three specified values.

License

Open Source License

Parameter

Parameter Description
a first value
b second value
c third value

Return

the maximum of the three values

Declaration

public static int max3(int a, int b, int c) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2016 - 2018 Roman Divotkey,
 * Univ. of Applied Sciences Upper Austria. 
 * All rights reserved./*  ww w  . j a  va2s.c o  m*/
 *   
 * This file is subject to the terms and conditions defined in file
 * 'LICENSE', which is part of this source code package.
 *    
 * THIS CODE IS PROVIDED AS EDUCATIONAL MATERIAL AND NOT INTENDED TO ADDRESS
 * ALL REAL WORLD PROBLEMS AND ISSUES IN DETAIL.
 *******************************************************************************/

public class Main {
    /**
     * Returns the maximum of the three specified values.
     * 
     * @param a
     *            first value
     * @param b
     *            second value
     * @param c
     *            third value
     * @return the maximum of the three values
     */
    public static int max3(int a, int b, int c) {
        return Math.max(Math.max(a, b), c);
    }

    /**
     * Returns the maximum of the three specified values.
     * 
     * @param a
     *            first value
     * @param b
     *            second value
     * @param c
     *            third value
     * @return the maximum of the three values
     */
    public static double max3(double a, double b, double c) {
        return Math.max(Math.max(a, b), c);
    }
}

Related

  1. max(T v1, T v2, int nullSupport)
  2. max2(double a, double b)
  3. max2(int a, int b)
  4. max255(float val)
  5. max3(double a, double b, double c)
  6. max3(int first, int second, int third)
  7. MAX3(int x, int y, int z)
  8. max4(double v1, double v2, double v3, double v4)
  9. max8(double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)