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
- cache
- equals
- VUE
- 재정의
- 조합
- static
- hashcode
- docker
- 인덱스
- stream
- Exception
- lambda
- Test
- SQL
- StringBuilder
- 필드 주입
- 생성자 주입
- redis
- AOP
- select_type
- DDL
- java
- 열 속성
- Spring
- KEVISS
- jwt
- DI
- 테스트 코드
- MSA
- jpa
Archives
- Today
- Total
목록tostring (1)
백엔드 개발자 블로그
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