-
Notifications
You must be signed in to change notification settings - Fork 5
240528 김우정 0x04 풀이 #15
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
Conversation
heegane
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.
고생하셨습니다 😎
0x04/김우정/방_배정.java
Outdated
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.
오늘 다시 말씀드리려고 했는데, buffer.write()는 데이터를 버퍼에 쓰는 메서드이고, 버퍼에 있는 데이터를 실제로 출력하는 메서드는 buffer.flush()입니다. BufferedWriter 객체의 close() 메서드를 호출하면, 스트림을 닫기 전에 자동으로 flush()가 호출됩니다. 따라서 flush()를 명시적으로 호출하지 않아도 스트림을 닫으면 남아있는 버퍼의 내용이 모두 출력 스트림으로 전송하게 된다고 합니다!
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.
오오 좋은 정보 감사합니다! 이 내용에 대한 정보 추가로 더 알아볼게요:)
0x04/김우정/에디터.java
Outdated
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.
저는 if문으로 중첩해서 써서 코드가 다소 지저분해 보였는데, 우정님은 switch문 쓰셔서 코드의 가독성이 좋네요!
0x04/김우정/요세푸스_문제.java
Outdated
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.
입력값이 간단하면 StringTokenizer를 import해서 쓰기 보단 우정님처럼 input[0], input[1] 이렇게 접근해도 좋겠다는 생각이 드네요..🤔
0x04/김우정/키로거.java
Outdated
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.
저는 ListIterator가 익숙하지 않아서 index로 접근하는 방식으로 풀었는데 확실히 ListIterator를 활용하는 게 성능상 좋을 것 같네요 🤣
0x04/김우정/키로거.java
Outdated
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문이라서 아래에 break가 필요할까? 하는 의문을 가졌는데, 검색해 보니까 코드의 가독성과 유지보수를 고려해서 의도적으로 다음 케이스로 넘어가지 않겠다는 명확한 신호를 주기 위해 break 문을 추가하는 경우도 있다고 하더라구요! 의도하신 걸까요?!
240528 김우정 0x04 풀이