Find minimum of two numbers using Math.min - Java Language Basics

Java examples for Language Basics:Math

Description

Find minimum of two numbers using Math.min

Demo Code


public class Main {
 
  public static void main(String[] args) {
   //from  w  ww .  ja v a2 s.  c o  m
    System.out.println(Math.min(12,34));
   
     System.out.println(Math.min(12.34f, 12.34f));
 
     System.out.println(Math.min(4.3, 3.2));
   
     System.out.println(Math.min(48,42));
  }
}

Result


Related Tutorials