Open
Conversation
Author
|
PR을 잘못 제출했다는 것을 오늘 알고 늦게 제출했습니다.. 그렇다고 완벽한 코드는 아니지만 계속 고쳐보도록 하겠습니다 죄송합니다 |
dradnats1012
left a comment
There was a problem hiding this comment.
고생하셨습니다!
중복되는 내용에 대한 리뷰는 한번만 남겼는데 확인하고 모두 적용해보면 좋을 것 같아요~!
| public class Application { | ||
| public static void main(String[] args) { | ||
| // TODO: 프로그램 구현 | ||
| ArrayList<Car> cars = new ArrayList<>(); |
There was a problem hiding this comment.
Suggested change
| ArrayList<Car> cars = new ArrayList<>(); | |
| List<Car> cars = new ArrayList<>(); |
보통 이렇게 선언해서 사용합니다!
저번주 강의 보시고 다형성에 대해 공부해보면 좋을 것 같아요 :)
| System.out.println("경주할 자동차 이름을 입력하세요."); | ||
| String name = readLine(); | ||
| String[] Name = name.split(","); | ||
| for(String n: Name){ |
There was a problem hiding this comment.
n 이라는 변수명보다는 name으로 사용하면 좋을것 같아요
Suggested change
| for(String n: Name){ | |
| for(String name: names){ |
| ArrayList<Car> cars = new ArrayList<>(); | ||
| System.out.println("경주할 자동차 이름을 입력하세요."); | ||
| String name = readLine(); | ||
| String[] Name = name.split(","); |
| cars.add(car); | ||
| } | ||
| System.out.println("시도할 회수는 몇회인가요?"); | ||
| int Count = Integer.parseInt(readLine()); |
There was a problem hiding this comment.
변수명은 보통 소문자로 시작합니다!
카멜케이스에 대해 알아보고 적용해보면 좋을 것 같아요!
src/main/java/racingcar/racing.java
Outdated
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class racing { |
Comment on lines
21
to
22
|
|
||
|
|
src/main/java/racingcar/Car.java
Outdated
|
|
||
| void move(){ | ||
| int num = Randoms.pickNumberInRange(0,9); | ||
| if(num>4){ |
There was a problem hiding this comment.
4라는 숫자가 무엇을 의미하는지 나타내줘도 좋을 것 같아요!
ex) private static final int MOVE_NUM = 4
src/main/java/racingcar/Car.java
Outdated
| this.Distance = ""; | ||
| } | ||
|
|
||
| void move(){ |
There was a problem hiding this comment.
접근제어자가 빠졌네요!
아니면 default로 사용한 이유가 있으실까요?
src/main/java/racingcar/Car.java
Outdated
Comment on lines
5
to
6
| protected String Name; | ||
| protected String Distance; |
Comment on lines
+8
to
+9
| if (Name == null || Name.length() > 5) | ||
| throw new IllegalArgumentException(); |
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.
No description provided.