Java Assignment3 upload by MiyeonLee#27
Open
miyounlee wants to merge 5 commits intoFastCampusKDTBackend:mainfrom
Open
Java Assignment3 upload by MiyeonLee#27miyounlee wants to merge 5 commits intoFastCampusKDTBackend:mainfrom
miyounlee wants to merge 5 commits intoFastCampusKDTBackend:mainfrom
Conversation
lalwr
reviewed
Apr 24, 2023
lalwr
left a comment
There was a problem hiding this comment.
과제하느라 고생하셨습니다 👍
작성한 코드가 잘 작동하는지 테스트 코드를 작성해보는건 어떨까요?
| } | ||
|
|
||
| public Electronic(String modelName, Company companyName, String dateOfMade, AuthMethod[] authMethod) { | ||
| serialNum++; |
| private String userEmail; | ||
| private int userBirthDate; | ||
| private String[] electronicDevices; | ||
| public LocalTime registerTime; |
There was a problem hiding this comment.
과제는 LocalDate 를 사용하라고 나와있는데 LocalTime 를 사용하고 있네요.
Author
There was a problem hiding this comment.
Electronic 클래스의 productNo은 LocalTime을 사용하라고 언급되어 있는데
User클래스의 registerTime에 대해선 언급이 없는 것 같습니다!
근데 멘토님 코멘트 보고 생각해보니, 회원정보 등록 시간에 대한 필드니까 날짜와 시간이 같이 출력되도록 하는 것이 좋을 것 같습니다. 참고해서 수정해보겠습니다.🤓
| return instance; | ||
| } | ||
|
|
||
| User findByUserId(String userId) { |
|
|
||
| User findByUserId(String userId) { | ||
| for(User user : userList) { | ||
| if(user.getUserId().equals(userId)) |
|
|
||
| User copy(User user) { | ||
| User userCopy = new User(user.getUserId(), user.getUserPassword(), user.getUserPhoneNumber() | ||
| , user.getUserEmail(), user.getUserBirthDate(), user.getElectronicDevices()); |
There was a problem hiding this comment.
.getElectronicDevices() 의 데이터를 변경하면 어떻게 될까요?
| } | ||
|
|
||
| User copy(User user) { | ||
| User userCopy = new User(user.getUserId(), user.getUserPassword(), user.getUserPhoneNumber() |
| } | ||
|
|
||
| private Electronics getInstance() { | ||
| if (!(instance == null)) return instance = new Electronics(); |
There was a problem hiding this comment.
null 일때 생성해야 하지 않을까요?
Suggested change
| if (!(instance == null)) return instance = new Electronics(); | |
| if ((instance == null)) return instance = new Electronics(); |
|
|
||
| int j = 0; | ||
| for (int i = 0; i < electronicList.length; i++) { | ||
| if (electronicList[i].getAuthMethod().equals(authMethod)){ |
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.
코드리뷰 빡세게 부탁드립니다!