
🖨 자바에서의 객체 복사자바에서의 객체 복사는 얕은 복사와 깊은 복사가 존재한다. 둘의 차이를 알아보자사용할 예제는 다음과 같다. import java.util.Objects;class Book { private String name; // 책 이름 private Author author; // 저자 public Book(String name, Author author) { this.name = name; this.author = author; } public Book shallowCopy() { // 얕은 복사 return new Book(this.name, this.author); } public Book deepCopy() { // 깊은 복사 Author copiedAuthor = new ..
java
2024. 11. 27. 13:50
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- @Spring
- 자바
- Spring
- Optional
- springboot
- ddl-auto
- 동등성
- StreamAPI
- NPE
- Java
- 티스토리챌린지
- 일급컬렉션
- N+1문제
- id생성전략
- Thymeleaf
- @ConfigurationProperties
- 유효성 검사
- 이진탐색
- JPA
- uncheckedException
- @NoArgsConstructor
- 메인메소드
- @Value
- null
- 오블완
- upperBound
- lowerBound
- 백준
- checkedException
- 생성자
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함