Open
Conversation
otter2023
reviewed
Mar 18, 2024
|
|
||
| public class LottoController { | ||
| private static final int TICKET_PRICE = 1000;//로또 개당 가격 | ||
| private static final int PERCENTAGE = 100;//추후 성공률 계산에 이용 |
Member
There was a problem hiding this comment.
상수를 따로 지정해둔 부분이 좋은 것 같습니다! 그런데 클래스를 따로 만들어서 상수들을 모아두는 것도 좋을 것 같아요
o0Orangee
reviewed
Mar 18, 2024
| throw new IllegalArgumentException(); | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
이 함수는 PlayerLottoAmount 클래스 내부에서만 쓰는 것 같은데 접근지정자를 private로 바꾸는 게 어떨까요?
o0Orangee
reviewed
Mar 18, 2024
| throw new IllegalArgumentException(); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
이 함수도 마찬가지로 접근지정자를 private로 바꾸는 게 어떨까요
o0Orangee
reviewed
Mar 18, 2024
| for(int i = Ranking.values().length -1; i >= 0; i--){//3~6순으로 해야되므로 인덱스 역순으로 출력하게 작성 | ||
| Ranking.values()[i].printMessage(result.get(Ranking.values()[i]));//헤당 enum객체의 정보 출력 | ||
| } | ||
| } |
o0Orangee
reviewed
Mar 18, 2024
|
|
||
| public boolean containNumber(int number){//로또 리스트에 해당 숫자가 있는지 검사할 수 있는 메서드 | ||
| return numbers.contains(number); | ||
| } |
There was a problem hiding this comment.
이거 굳이 필요 없어 보이는데 쓰신 이유가 있나요? 그냥 contains 써도 똑같은 거 아닌가요??
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
테스트 코드 부분은 감이 잘 안 잡혀서 완성하지 못하였고 main에서 돌렸을 때 잘 출력되는 것 까지만 일단 확인하였습니다..!(예외처리 부분도 미숙한 부분이 많이 있는 것 같습니다)