"자바 클래스 HashMap"의 두 판 사이의 차이

8번째 줄: 8번째 줄:
member.put("Name", "YONEZAWA Akinori");
member.put("Name", "YONEZAWA Akinori");
member.put("Address", "Naha, Okinawa");
member.put("Address", "Naha, Okinawa");
System.out.println( member );
System.out.println( member );
// {Address=Naha, Okinawa, ID=102, Name=YONEZAWA Akinori}
// {Address=Naha, Okinawa, ID=102, Name=YONEZAWA Akinori}
for(Entry<String, Object> m:member.entrySet()){ 
System.out.println( m.getKey()+": "+m.getValue() ); 
}
// Address: Naha, Okinawa
// ID: 102
// Name: YONEZAWA Akinori
</source>
</source>



2017년 4월 13일 (목) 10:38 판

1 개요

Java HashMap
자바 해쉬맵
HashMap<String,Object> member = new HashMap<String,Object>();
member.put("ID", "102");
member.put("Name", "YONEZAWA Akinori");
member.put("Address", "Naha, Okinawa");

System.out.println( member );
// {Address=Naha, Okinawa, ID=102, Name=YONEZAWA Akinori}
for(Entry<String, Object> m:member.entrySet()){  
	System.out.println( m.getKey()+": "+m.getValue() );  
}
// Address: Naha, Okinawa
// ID: 102
// Name: YONEZAWA Akinori

2 같이 보기

3 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}