하나의 문자열에서 여러 토큰(Token)을 생성
지정된 분리자(delimiters)를 사용
기본 분리자는 ₩t₩n₩r₩f으로 공백문자와 탭(₩t)과 같은 4개의 제어문자
다른 분리자를 지정하고 싶다면 StringTokenizer의 생성자에서 2번째 인자에 기술
분리자를 토큰에 포함시키려면 StringTokenizer의 생성자에서 3번째 인자를 true로 지정
web: client → server
서버주소: 포트/경로?전송데이터(키(key):값(value)&키:값&키:값…)
127.0.0.1:8090/join.do??전송데이터
IP:Port/login.do?userID=m1111%userPW=1111&userName=s1111
(파이썬 딕셔너리랑 비슷하다)
Date now = New Date(); 와 짝궁 // 날짜 생성
SimpleDateFormat = new SimpleDateFormat(”yyyyMMdd”); // 날짜포맷
format.format(now); // 날짜를 날짜포맷
System.out.println(format.format(now)); //2022-11-16
format = new SimpleDateFormat(”E MMM dd HH:mm:ss”, Locale.Korea);
System.out.println(format.format(now)); // Wed Nov 16 15:12:22
//특정 지역의 표준 시간 설정
DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT,Local.KOREA);
날짜와 시간에 관한 정보를 제공하는 추상클래스
자체의 생성자를 이용하여 객체 생성 불가능
정적메소드 getInstance() → new x → 싱글톤 패턴으로 객체를 생성(내부클래스, Dao)
메서드 getTime()
1. 반환형은 Date로써, 바로 출력하면 영문 표현의 시간 정보를 출력 가능
Calendar now = Calendar.getInstance();
System.out.println(now.getTime());
LocalDate
// 컴퓨터의 현재 날짜 정보 리턴
LocalDate iDate = LocalDate.now();
//파라미터로 주어진 날짜 정보 리턴
LocalDate targetDate = LocalDate.of(int year, int month, int dayOfMonth);
LocalTime
// 컴퓨터의 현재 시간 정보.
LocalTime currentTime = LocalTime.now();
//파라미터로 주어진 시간 정보 리턴
LocalTime targetTime = LocalTime.of(시, 분, 초, 나노시간);
LocalDateTime
// 컴퓨터의 현재 날짜와 시간정보
LocalDateTime currentDateTime = LocalDateTime.now();
LocalDateTime targetDateTime = LocalDateTime.of(년, 월, 일, 시, 분, 초, 나노시간);
ZonedDateTime
ZonedDateTime utcDateTime = ZonedDateTime.now(ZoneId.of("UTC"));
ZonedDateTime seoulDateTime = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
//UTC : 전세계 협정세계시 (영국런던기준)
//UTC+9 : 대한민국 표준시(KST)
//→ AWS → EC → “Asia/Seoul”
클래스명으로 Calendar를 쓰면 import시에 에러가 뜬다.
예약어 = 키워드
tip