StrictMath.min(int, int): This method is available in java.lang.StrictMath class of Java.
Syntax:
int java.lang.StrictMath.min(int a, int b)
This method takes two arguments of type int as its parameters. This method returns the smaller of two int values. That is the result of the argument closer to the value of Integer.MIN_VALUE.
Note:
1. If the arguments have the same value, the result is the same value.
Parameters: Two parameters are required for this method.
a: an argument.
b: another argument.
Returns: the smaller of a and b.
Exceptions: NA
Approach
Java
public class StrictMathminint {public static void main(String[] args) {int a = 178, b = 19;System.out.println(StrictMath.min(a, b));}}
Output:
19
Some more min() Methods of StrictMath class.
StrictMath.min(double, double)
No comments:
Post a Comment