| 1 | ±âº»ÀÚ·áÇü |
|
ÀÚ¹Ù¿¡¼ ±âº»ÀÚ·áÇüÀº ´Ù¸¥ ¾ð¾î¿Í ¸¶Âù°¡Áö·Î Á¤¼ö,½Ç¼ö,¹®ÀÚ,ºÒ¸°Çü ±×¸®°í ¹®ÀÚ¿ÇüÀ» Áö¿øÇÏ¸ç ±× ¼¼ºÎ»çÇ×Àº ¾Æ·¡¿Í °°´Ù. ¢Ñ Á¤¼öÇü(int) ¢Ñ ½Ç¼öÇü(float, double) ¿¹) float myfloat; // floatÇü ºÎµ¿¼Ò¼öÁ¡ ¢Ñ ¹®ÀÚÇü ¿¹) char characterval; // ¹®ÀÚÇü º¯¼ö ¼±¾ð
¢Ñ Boolean ¿¹) boolean mybool; // Boolean Çü º¯¼ö ¼±¾ð |
| 2 | ±âº»ÀÚ·áÇüÀ» »ý¼ºÇßÀ» ¶§ÀÇ µðÆúÆ®°ª |
|
¿©±â¿¡¼ ³ª¿Â °¢ ÀÚ·áÇüÀ¸·Î º¯¼ö¸¦ ¼±¾ðÇÑ ÈÄ¿¡ °ªÀ» ÇÒ´çÇÏÁö ¾ÊÀº °æ¿ì¿¡´Â ´ÙÀ½°ú °°Àº µðÆúÆ®(default)°ªÀÌ µé¾î°¡°Ô µÈ´Ù. ¢Ñ ±âº»µåÆúÆ®°ª int : 0 long:0 float: 0.0f double:0.0d byte:0 char:\u00000 boolean:false |
| 3 | DataTest.java¿¹Á¦ |
|
class DataTest { intval = 15; System.out.println("Data Type¿¡ ´ëÇÑ ¿¬½À"); |
| °á°úȸé | ¢Ñ Data Type¿¡ ´ëÇÑ ¿¬½À ====================== Integer DataType 15 Float DataType 15.345 Double DataType 15.12 Character DataType a Boolean DataType true |