일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- 날짜클래스
- MacTomcat
- OutputStream
- 맥명령어
- 포맷팅
- 타이머테스크
- githubpage
- 입출력
- 랜덤클래스
- 이클립스 ANt
- 맥숨긴폴더
- 폴더재설정
- 맥톰캣설치
- githubblog
- API
- InputStream
- equals
- random
- 윈도우Ant
- throws
- java
- NullPointException
- 태그를 입력해 주세요.
- Ant설치
- 맥단축키
- auto boxing
- 터미널명령어
- 널포인트
- antbuild
- 맥Ant설치
- Today
- Total
Platonic의 조금은 재밌는 일상
Try / catch public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("숫자 1개를 입력하세요."); try { int value = 100; int x = Integer.parseInt(scanner.nextLine()); System.out.println(value / x); //입력한 숫자와 나눈다. } catch (Exception e){ System.out.println("잘못입력하셨습니다."); e.printStackTrace(); //어디서 잘못되었는지 알려준다. } } throws Exception예외를 현재 코드에서 직접 처리하지 않고, 코드가 호출된 곳으..
Formatter출력하는 형태를 format이라고 하고, Formatter는 데이터의 출력형태를 지정하는 것 문자열 포맷팅%S소수 포맷팅%.3f날짜 포맷팅%tY, %ty, %tm, %td, %tA, %ta public static void main(String[] args) { //문자열 포멧팅 String str1 = "이"; String str2 = "진서"; System.out.println(" 당신의 성은 " + str1 + "이름은 " + str2 + " 입니다. "); System.out.println(" 당신의 성은 " + str1.toUppercase(); + "이름은 " + str2 + " 입니다. "); //var args System.out.printf("당신의 성은 %s이고 당신의 ..
약간의 시간(interval)을 두고 어떤 작업을 하고 싶은 경우에 사용 작업 순서 TimerTask를 상속해서 하고 싶은 작업 작성 Timer객체를 이용해서 Schedule 등록 public class YourJob extends TimerTask { @override public void run() { System.out.println("YourJob"); } } public class MyJob extends TimerTask { @override public void run() { System.out.println("MyJob"); } } public static void main(String[] args) { Timer timer = new Timer(); MyJob job1 = new Myjo..