-
Notifications
You must be signed in to change notification settings - Fork 13
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
1주차 Assignment - 조규림 #12
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.
과제 수정 부탁드립니다!
for (int k = 0; k < arr.length; k++) | ||
System.out.print(arr[k] + " "); | ||
|
||
|
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.
Scanner 객체와 같은 자원은 사용 후에는 닫아주는 것이 좋습니다! sc.close() 메서드를 추가해 자원 누수를 방지할 수 있습니다!
import java.util.Scanner; | ||
public class Main { | ||
public static void main(String[] args) { | ||
Scanner sc = new Scanner(System.in); |
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.
엄청 많은 데이터를 처리해야 할 경우 BufferedReader를 쓰는 것이 훨씬 효율적입니다! 한 번 공부해보시면 좋을 것 같습니다. 또한 문자열 생성을 StringBuilder로 생성해 한 번에 출력하는 것이 메모리 부족 방지에 도움이 될 수 있습니다! 참고 링크 입니다! https://rlakuku-program.tistory.com/33
package assign2; | ||
|
||
class Cylinder { | ||
final double PI = 3.14; // 원주율 3.14를 정적 상수 PI로 선언과 동시에 초기화 |
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.
PI 변수는 상수입니다. 정적 상수는 어떤걸까요?
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.
과제 통과입니다 🥳 고생 많으셨습니다!
Description
<!— 구현 및 작업 내용을 적어주세요 —>
Important content
<!— 주의 깊게 봐줬으면 하는 부분을 적어주세요 —>
Question
<!— 궁금한 점을 적어주세요 —>
Reference
<!— 참고한 레퍼런스가 있다면 공유해 주세요 —>