How to Use Math.min(x,y) in Java


In this example, we will learn you how to use math.min(x,y) to return the lowest value of x and y in Java.

Source Code

package com.beginner.examples;

public class Min {
  public static void main(String[] args) {
    System.out.println(Math.min(3, 7)); // return the lowest value
  }
}

Output:

3
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments