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
- try-catch-finally
- intelij
- try-with-resources
- 동작방식
- jetbrain
- wagon-ssh
- resilience4j
- circuitbreaker
- Runtime data area
- optional
- try-catch
- feign
- jvm
- closeable
- webflux
- 4-way-handshake
- zipWith
- n+1
- springboot
- 람다표현식
- 날짜쿼리
- java
- Kotlin
- Class Loader
- Hotspot VM
- AutoCloseable
- GC
- 코딩테스트
- tcp
- execution engine
Archives
- Today
- Total
목록stringbuffer (1)
JuBin's personal study blog
[JAVA] String, StringBuilder, StringBuffer 차이점
String String은 불변(Immutable) 속성을 갖는다. 멀티쓰레드 환경에서 안전하다(thread-safe) String str = "hello~"; // String str = new String("hello~") - 1 str = str + "world"; - 2 1) str은 stack영역에 저장, "hello~"는 heap영역에 저장된다 2) str은 stack영역에 그대로지만 "hello~"는 Garbage가되고 str은 새로운 "hello~world"를 참조한다. 연산이 적은(문자열 추가, 수정, 삭제) 경우 사용하면 좋은성능을 기대할 수 있다. 알고리즘에 String클래스를 사용하면 Heap영역에 많은 Garbage가 쌓여 힙메모리 부족현상이 일어날 수 있다. 따라서 연산횟수가 많..
JAVA
2021. 4. 14. 10:21