You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
DB 관통을 하면서 테스트 결과로 출력해야 하는 일이 있었는데
각기 다른 DTO마다 출력하기 귀찮아서 비한정적 와일드카드를 사용하여 결과를 반환하는 함수를 만들었습니다.
비한정적 와일드카드를 사용했기 때문에 읽기 전용인 toString() 함수만 사용했습니다.
이를 통해 두 개의 dto에 대해 하나의 함수로 결과를 출력할 수 있었습니다.
두 개의 dto 객체는 별도의 관계가 없어서 비한정적 와일드카드를 사용했고 굳이 Object를 쓰는 것보다 toString()은 모두 구현되어 있기 때문에 ?를 사용했습니다. (뭔가 Object는 제 스타일상 손이 잘 안 가는 거 같습니다.)
Beta Was this translation helpful? Give feedback.
All reactions