Skip to content

Conversation

@525tea
Copy link

@525tea 525tea commented Oct 29, 2025

No description provided.

525tea added 23 commits October 27, 2025 13:47
Copy link

@Eunsaem03 Eunsaem03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2주차 고생많으셨습니다! 이번에도 궁금한 것 위주로 질문 했습니다..ㅎㅎ.. 코드에 많은 도움이 되어드리지 못해 죄송합니다😂 저희 3주차도 파이팅해요~~!

@@ -0,0 +1,3 @@
package racingcar.model.car;

public record CarStatus(String name, int position) { }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 어떤 건가요?? 클래스인가요? 어떨 때 사용하나요?!

private void validateDuplicateNames(List<Car> cars) {
Set<String> uniqueNames = cars.stream()
.map(Car::name)
.collect(Collectors.toSet());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stream에 대해서 찾아보다가 .toList()가 .collect(Collectors.toList())를 간결한 형태로 사용했다는 걸 봤는데요! 이것도 .toSet()으로 간결하게 작성이 가능한가요?


public int maxPosition() {
return cars.stream()
.mapToInt(Car::position)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.map이랑 .mapToInt의 차이점이 뭔가요?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 3주차 과제는 상수화해서 사용해보려고 합니다 많이 보고 배워요 감사합니다!


private final Cars cars;
private final RoundLimit roundLimit;
private final List<List<CarStatus>> roundSnapshots = new ArrayList<>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 List 안에 List를 넣는 건가요?

this.roundLimit = roundLimit;
}

public static RacingGame of(Cars cars, RoundLimit roundLimit) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저번 주차 코드에서는 List.of에 대해서 물어보면서 불변 리스트 만들 때 사용한다고 알려주셨는데요 여기서 사용하는 of는 어떨 때 사용하나요? 무슨 의미인가요?

Comment on lines +3 to +6
@FunctionalInterface
public interface ValueGenerator {
int getValue();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인터페이스는 어떨 때 사용하나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants