ÀÌ·±....


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :±Ç¿ë¼® 2000³â 6¿ù 11ÀÏ 15:29:34

In Reply to: Á» µµ¿Í ÁÖ¼¼¿ä...»¡¸®ÇؾßÇϴµ¥... posted by ±èÁø¾Æ on 2000³â 6¿ù 10ÀÏ 02:44:38:

ÀÌ·±.. Á¦°¡ ³Ê¹« ¼ºÀǾøÀÌ ´äº¯À» Çصå·È³ªº¸±º¿ä.
¾Æ¿¹ ÀÌ°Å°°´Ù°¡ ¾²¼¼¿ä.


package test;
import java.util.*;


class Students{
int age;
public Students(int age){
this.age=age;
}
}


public class test{
public static void main(String[] args){
Hashtable table = new Hashtable();
table.put("0",new Students(23));
table.put("1",new Students(24));
table.put("3",new Students(25));
Integer[] keys={new Integer(3),new Integer(1)};
for(int i=0; i<keys.length; i++){
Students st=(Students)table.get(keys[i].toString ());
System.out.println(st.age);
}
}
}


Âü°í·Î ¼³¸íÀ» µå¸®ÀÚ¸é ÀÏ´Ü hashtableÀÇ Å°°¡ StringÀÌÁÒ.
±×·¯´Ï±î key[i]À» StringÀ¸·Î ¹Ù²Ù°í¿ä, ±×´ÙÀ½Àº Á¤¼ö°ªÀÌ ³Ê¹« Å©°Ô ¼³Á¤À̵Ʊ⶧¹®¿¡ ÀÛÀº ¼ýÀÚ·Î ¹Ù²ã½À´Ï´Ù.


´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]