-
Notifications
You must be signed in to change notification settings - Fork 55
[임현희_BackEnd] 1주차 과제 제출합니다. #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
PR을 잘못 제출했다는 것을 오늘 알고 늦게 제출했습니다.. 그렇다고 완벽한 코드는 아니지만 계속 고쳐보도록 하겠습니다 죄송합니다 |
dradnats1012
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
중복되는 내용에 대한 리뷰는 한번만 남겼는데 확인하고 모두 적용해보면 좋을 것 같아요~!
| public class Application { | ||
| public static void main(String[] args) { | ||
| // TODO: 프로그램 구현 | ||
| ArrayList<Car> cars = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n 이라는 변수명보다는 name으로 사용하면 좋을것 같아요
| for(String n: Name){ | |
| for(String name: names){ |
| ArrayList<Car> cars = new ArrayList<>(); | ||
| System.out.println("경주할 자동차 이름을 입력하세요."); | ||
| String name = readLine(); | ||
| String[] Name = name.split(","); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names 라는 네이밍은 어떨까요?
| cars.add(car); | ||
| } | ||
| System.out.println("시도할 회수는 몇회인가요?"); | ||
| int Count = Integer.parseInt(readLine()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변수명은 보통 소문자로 시작합니다!
카멜케이스에 대해 알아보고 적용해보면 좋을 것 같아요!
src/main/java/racingcar/racing.java
Outdated
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class racing { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
클래스는 대문자로 시작합니다!
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 개행들은 지워도 될 것 같아요!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
접근제어자가 빠졌네요!
아니면 default로 사용한 이유가 있으실까요?
src/main/java/racingcar/Car.java
Outdated
| protected String Name; | ||
| protected String Distance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected로 선언한 이유가 궁금해요
| if (Name == null || Name.length() > 5) | ||
| throw new IllegalArgumentException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
검증하는 로직은 메서드로 따로 빼도 좋을 것 같아요 :)
No description provided.