Here you can find the source of max3(int a, int b, int c)
Parameter | Description |
---|---|
a | first value |
b | second value |
c | third value |
public static int max3(int a, int b, int c)
//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); } }