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 |
Tags
- 조합
- Test
- 인덱스
- 바이너리 카운팅
- SQL
- 테스트 코드
- 필드 주입
- StringBuilder
- java
- VUE
- DDL
- Spring
- 열 속성
- select_type
- stream
- jwt
- equals
- hashcode
- static
- lambda
- AOP
- redis
- jpa
- MSA
- 재정의
- KEVISS
- 생성자 주입
- docker
- cache
- DI
Archives
- Today
- Total
목록tostring (1)
백엔드 개발자 블로그
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/YQcFi/btsGnHZGnBm/eH8turIMDHQ0emcV320bcK/img.png)
toString 재정의 해야하는 이유 Object의 기본 toString메서드는 기본적으로 클래스 이름@16진수로 표현한 해시코드를 반환합니다. 실제로 Object.java파일의 toString메서드를 보면 다음과 같습니다. public String toString() { return getClass().getName() + "@" + Integer.toHexString(hashCode()); } 실제로 Car를 출력하였을 때 Car@6b71769e라는 결과가 나온 것을 확인할 수 있습니다. public class Car { private String name; private int position; } public class Main { public static void main(String[] arg..
Java
2024. 4. 4. 22:46