±Û¾´ÀÌ :À§¼ºÇõ 2000³â 5¿ù 06ÀÏ 02:42:51
In Reply to: int Çü ¹è¿À» StringÇü ¹è¿·Î ¸¸µé¾î ÁÙ¼ö´Â ¾ø³ª¿ä? posted by int Çü ¹è¿À» StringÇü ¹è¿·Î ¸¸µé¾î ÁÙ¼ö´Â ¾ø³ª¿ä? on 2000³â 5¿ù 06ÀÏ 01:02:48:
{
public int [] a = {123,456,37};
public String[] str = new String[3];
public void IntToString()
{
for(int i=0;i<3;i++)
{
str[i] = Integer.toString(a[i]);
}
}
public void Print()
{
for(int i=0;i<3;i++)
{
System.err.println(str[i]);
}
}
public static void main(String [] args)
{
StringEx ex = new StringEx();
ex.IntToString();
ex.Print();
}
}
// ¹®Á¦ÀÇ ¿äÁ¡ÀÌ int¸¦ stringÀ¸·Î ¹Ù²Ù¾î Áִ°ÍÀÌ °¡Àå Áß¿äÇÑ ¹®Á¦À̶ó »ý°¢ µË´Ï´Ù. Integer class¿¡ º¸¸é toString(int value)°¡ ÀÖ½À´Ï´Ù. ±× ÇÔ¼ö´Â ÀÔ·ÂµÈ value¸¦ StringÀ¸·Î ¹Ù²Ù¾î ÁÖÁÒ ±× ÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¸é µÉ µí ÇÕ´Ï´Ù. °£´ÜÇÑ source¿Ã¸³´Ï´Ù. ±×·³ µµ¿òÀÌ µÇ¸é ÁÁ°Ú½À´Ï´Ù.