-
Notifications
You must be signed in to change notification settings - Fork 0
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
Java Assignment3 upload by TaeIlKIm #13
base: main
Are you sure you want to change the base?
Conversation
|
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.
과제하느라 고생하셨습니다 👍
깊은 복사와 얕은 복사에 대해 현재 이해하고 있는 부분을 정리해보시고 이해가 안되는 부분에 대해 얘기를 하면 좋을꺼 같습니다~
CAPACITY
는 기본 배열 크기를 지정하기 위해 사용하는 것이 목적입니다.
만든 코드에 대한 테스트 코드도 작성해보시면 좋지 않을까요?
public class Electronic { | ||
private static int serialNumber = 0; | ||
|
||
String productNo; |
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.
접근제한자가 없는 이유가 있을까요?
this.productNo = today.format(DateTimeFormatter.ofPattern("yyMMdd")); | ||
this.productNo += String.format("%04d", serialNumber); | ||
this.companyName = companyName; | ||
authMethods.add(auth); |
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.
authMethods도 리스트로 받는것이 좋지 않을까요?
this.userPhoneNumber = userPhoneNumber; | ||
this.userEmail = userEmail; | ||
this.userBirthDate = userBirthDate; | ||
} |
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.
registerTime
셋팅하는 부분이 빠졌네요.
String userPhoneNumber, | ||
String userEmail, | ||
String userBirthDate | ||
|
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.
electronicDevices
는 빠진 이유가 있을까요?
|
||
// 싱글톤 | ||
private static Users instance; | ||
public Users() {} |
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
으로 객체가 생성하면 싱글톤이 아니지 않을까요?
|
||
public Electronic findByProductNo(String productNo) { | ||
for (Electronic electronic : electronicList) { | ||
if (electronic.getProductNo().equals(productNo)) { |
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.
equals
👍
private static Electronics instance; | ||
private static final int DEFAULT_CAPACITY = 10; | ||
private Electronic[] electronicList; | ||
private int size = 0; |
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.
size
를 셋팅하는 부분은 어디있나요?
int count = 0; | ||
for (int i = 0; i < electronicList.length; i++) { | ||
if (electronicList[i].getCompanyName().equals(company)) { | ||
groupByCompanyElectronic[count] = electronicList[i]; |
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.
배열에 넣은 후 count
를 증가해야 하지 않을까요?
int count = 0; | ||
for (int i = 0; i < electronicList.length; i++) { | ||
if (electronicList[i].getAuthMethods().equals(authMethod)) { | ||
groupByCompanyElectronic[count] = electronicList[i]; |
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.
배열에 넣은 후 count
를 증가해야 하지 않을까요?
public class Electronics { | ||
|
||
private static Electronics instance; | ||
private static final int DEFAULT_CAPACITY = 10; |
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.
기본 배열 크기를 지정하는 용도로 사용합니다.
실습 2번
실습 3번