-
Notifications
You must be signed in to change notification settings - Fork 55
[이재용_BackEnd] 1주차 과제 제출합니다. #46
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ | |
| import camp.nextstep.edu.missionutils.test.NsTest; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import camp.nextstep.edu.missionutils.Randoms; | ||
|
|
||
| import static camp.nextstep.edu.missionutils.test.Assertions.assertRandomNumberInRangeTest; | ||
| import static camp.nextstep.edu.missionutils.test.Assertions.assertSimpleTest; | ||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
@@ -36,3 +38,23 @@ public void runMain() { | |
| Application.main(new String[]{}); | ||
| } | ||
| } | ||
|
|
||
| class car { | ||
| private String name; | ||
| private int position; | ||
|
|
||
| car(String name){ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 클래스나 멤버변수, 메서드 앞에 오는 public, private, default 등이 어떤 역할을 할까요? 힌트: 접근제어자 |
||
| this.name = name; | ||
| this.position = 0; | ||
| } | ||
|
|
||
| private int ran() { | ||
| return Randoms.pickNumberInRange(0, 9); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 들여쓰기가 빠졌어요 |
||
| } | ||
|
|
||
| void move(){ | ||
| if(ran() >= 4){position += 1;} | ||
| } | ||
| String getname(){return name;} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
클래스는 '테스트', '자동차' 등 객체나 특정 단위에 따라 분리해보시길 바랍니다.