Java Integer min() Method25 Mar 2025 | 2 min read The min() is a method of Integer class under java.lang package. This method numerically returns the minimum value amongst the two method argument specified by a user. This method can be overloaded and it takes the arguments in int, double, float and long. Note: If a positive and a negative number is passed as an argument, it generated the negative result. And if both the parameters passed as a negative number, it generates a result with the greater magnitude.Syntax:Following is the declaration of min() method: Parameter:
Returns:The min() method returns the smaller value amongst the two method argument specified by a user. Exceptions:NA Compatibility Version:Java 1.5 and above Example 1Output: Math.min(5485,3242)=3242 Example 2Output: Enter the Two Numeric value: 45 76 Smaller value of Math.min(45,76) = 45 Example 3Output: Result: -70 Example 4Output: Result: -20 Next TopicJava-integer-numberofleadingzeros-method |
Java Method The floatValue() method is a method of Integer class under java.lang package. This method returns the float equivalent value of this Integer object. The floatValue() method were specified from the Number Class. It may also involve in rounding or truncation of the Integer...
3 min read
This method is used to get an unsigned String object representing the value of the Number Object. There is two different types of Java toUnsignedString() method which can be differentiated depending on its parameter. These are: Java Integer toUnsignedString(int i) Method Java Integer toUnsignedString(int i, int radix) Method 1....
3 min read
Java method The compareTo() method is a method of Integer class under java.lang package. This method compares two integer objects numerically. It returns the result of the value 0 if Integer is equal to the argument Integer, a value less than 0 if Integer is...
2 min read
Java Method The divideUnsigned() is a method of Java Integer class which returns the unsigned quotient of dividing the first argument by the second argument where each argument and the result is interpreted as an unsigned value. Syntax: Following is the declaration of divideUnsigned() method: public static int...
2 min read
Java Method The intValue() method is an instance method of Integer class under java.lang package. This method returns the value of the specified number as an int. It is inherited from the Number Class. Syntax: Following is the declaration of intValue() method: public int intValue() Parameter: DataType Parameter Description NA NA This method does not...
2 min read
Java method The bitCount() is a method of Integer class under java.lang package. It returns the number of one-bits in the two's complement binary representation of the specified int value. This function is sometimes referred to as the population count. Syntax Following is the declaration of bitCount()...
2 min read
Java Method The sum() method of Java Integer class numerically returns the sum of its arguments specified by a user. This method adds two integers together as per the + operator. It can be overloaded and accepts the arguments in int, double, float and long. Note:...
2 min read
Java Method The rotateLeft() method of Java Integer class returns the value obtained by rotating the two's complement binary representation of the specified int value left by the specified number of bits. (Bits shifted out of the left hand, or high-order). Bit shifting is a bitwise...
3 min read
Java Method The toUnsignedLong() is a Java Integer class method which converts the argument to a long by an unsigned conversion. In an unsigned conversion to a long, the high-order 32 bits of the long are zero and the low-order 32 bits are equal to...
2 min read
Java method The doubleValue() method is a static method of Integer class under java.lang package. This method returns the value of this Integer as a double equivalent. This method is specified by Number class and may involve rounding or truncation. Syntax Following is the declaration of doubleValue()...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India