Java Math min() is an inbuilt method that compares two numbers (can be of either int, float, double, or long type) and returns the minimum of two numbers.

Java Math min()

Java math.min() is an inbuilt function that returns a minimum of two numbers. The arguments are taken in int, float, double, and long, and if both parameters passed are negative, then a number with the higher magnitude is generated as a result.


public static int min(int a, int b)
public static double min(double a, double b)
public static float min(float a, float b)
public static long min(long a, long b)

#java #java math min

Java Math min() Function Example
1.50 GEEK