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 | 31 |
Tags
- HATEOAS
- 백트래킹
- AuthenticationPrincipal
- WebApplication Type
- Application Runner
- 스프링부트
- 외부설정
- 백기선
- Application Argument
- 리소스핸들러
- EnableAutoConfiguration
- 알고리즘
- cors
- JPA
- 백준
- Spring Security
- @Profile
- application.properties
- 리소스 서버
- rest api
- JsonSerializer
- Application Event
- 브루트포스
- 정적 리소스
- @ConfigurationProperties
- HttpMessageConverters
- OAuth2
- 스프링 부트
- 다익스트라
- webjar
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 |