feat :: 우주 탐사 관리 시스템 - 탐사대원의 정보, 탐사선 정보 입력 및 출력#3
Open
fakesilverpark wants to merge 4 commits intoSPACE-FOR-SPACE:mainfrom
Open
feat :: 우주 탐사 관리 시스템 - 탐사대원의 정보, 탐사선 정보 입력 및 출력#3fakesilverpark wants to merge 4 commits intoSPACE-FOR-SPACE:mainfrom
fakesilverpark wants to merge 4 commits intoSPACE-FOR-SPACE:mainfrom
Conversation
YunChan-Oh
reviewed
Aug 5, 2024
second/src/Spaceship.java
Outdated
|
|
||
| public class Spaceship { | ||
| private String spaceshipName; //탐사선이름 | ||
| private String spaceshipHumanStatus; //탐사선이 무인인지 유인인지 |
Member
There was a problem hiding this comment.
Enum이라는 타입도 있으니 공부해 보시고 코드 개선해 보아도 좋을 것 같습니다!
second/src/Spaceship.java
Outdated
Comment on lines
7
to
14
| private List<Astronaut> astronauts = new ArrayList<>(); //탑승한 탐사 대원 리스트 | ||
|
|
||
| Spaceship(){} | ||
|
|
||
| Spaceship(String spaceshipName, String spaceshipHumanStatus){ | ||
| this.spaceshipName = spaceshipName; | ||
| this.spaceshipHumanStatus = spaceshipHumanStatus; | ||
| } |
Member
There was a problem hiding this comment.
무인 우주선일 때는 리스트를 생성할 필요가 없으니 생성자에서 조건문을 사용해서 리스트 생성 로직을 분리해도 좋을 것 같습니다!
Member
|
적어주신 질문에 대해서 좀 더 자세히 설명해 주실 수 있으실까요? |
YunChan-Oh
reviewed
Aug 5, 2024
second/src/Spaceship.java
Outdated
Member
There was a problem hiding this comment.
무인과 유인에 따라서 변수가 필요없을 때도 있고 메서드 추가 조건문이 붙을 때도 있으니 상속을 사용해서 우주선 클래스를 만들고 무인선, 유인선 클래스를 각각 만들어서 우주선 클래스를 상속 받으면 좋을 것 같습니다!
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.
과제를 진행하면서 느낀 것이라면 무엇이든 적어주세요, 고민, 이슈, 질문 등 다 좋습니다!
예를들어서 제가 vsc에서 test라는 폴더에 처음에는 a라는 파일만 만들어서 커밋하고 다음에는 b라는 파일을 만들어서 원래하듯히 커밋을 하려면 오류가 뜨는데 이런 경우에는 어떻게 해야하나요?