¼Ò¼³ java.lang ¼Ò½ºÄڵ堠Math  06. Math.max  

µÎ ¼ö¸¦ ºñ±³Çؼ­ Å«°ªÀ» ¾Ë¾Æ³»´Â ¿¹Á¦

TestMax.java 

public class TestMax {
  
public static void 
main(String args[]) {
    
double a = 3.5
;
    
double b = 4.0
;

    System.out.println(
"The maximum of a and b is " 
+ Math.max(a, b));
  } 
}

C:\javaExample\Math>javac TestMax.java
C:\javaExample\Math>java TestMax
The maximum of a and b is 4.0

MathŬ·¡½ºÀÇ max()¸¦ ÀÌ¿ëÇØ¼­ µÎ ¼ö Áß¿¡ ´õ Å« °ªÀ» ¾ò¾î³¾ ¼ö ÀÖ´Ù. ºñ±³µÇ´Â °ªµéÀº °°Àº µ¥ÀÌÅÍ ÇüÀ̾î¾ß µÈ´Ù.



jabookÀúÀÚ¸íÇÔ
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå
ÀÛ¼ºÀÚ:Àںϸâ¹ö ÇÑâÇå