Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 리소스 서버
- 스프링부트
- 알고리즘
- rest api
- JPA
- HttpMessageConverters
- Application Runner
- 백기선
- WebApplication Type
- 백준
- @Profile
- HATEOAS
- Spring Security
- 리소스핸들러
- 다익스트라
- cors
- EnableAutoConfiguration
- webjar
- 스프링 부트
- AuthenticationPrincipal
- JsonSerializer
- 정적 리소스
- 브루트포스
- Application Event
- 외부설정
- Application Argument
- OAuth2
- application.properties
- @ConfigurationProperties
- 백트래킹
Archives
- Today
- Total
아카이브
HashMap과 HashTable 본문

1. HashTable은 thread-safe 하다. HashMap은 그렇지 않다.
- thread-safe란? 멀티스레드 환경에서 동시 접근이 발생하는 경우에도 값의 내용이나 프로그램 실행에 문제가 없음을 보장하는 것이다.
- 각 스레드에서 프로그램 실행 결과의 올바름을 보장한다.
- thread-safe는 synchronized cost를 발생시키므로, 단일 스레드 환경에서는 HashMap의 성능이 더 좋다.

2. HashTable의 key는 not-null이고, HashMap은 하나의 null key와 다수의 null value가 허용된다.
- HashTable의 key는 hashCode(), equals() 에서 사용되기 때문에 null을 허용하지 않는다.


'Java' 카테고리의 다른 글
equals()메소드와 hashCode()메소드 (0) | 2018.06.27 |
---|---|
final 키워드 (0) | 2018.06.27 |
Interface와 abstract class (0) | 2018.06.18 |
String 과 StringBuffer/StringBuilder (0) | 2018.06.18 |