Basic
- 접근제어자(Access Modifier)
- 변수의 유효 범위
- Method Signature
- 익명 클래스
- 객체 비교
- final 키워드
- static 키워드
- 삼항연산자
- Effectively final
- final, finally, finalize의 차이점
- instanceOf 연산자
- Number Class
- Primitive Type Casting(형변환)
- printf()로 문자열 포맷 출력
- 문자열 공백제거 (trim, replace)
- 반올림해서 소수점 n번째 자리까지 출력
- 문자열을 연결(concat, StringBuilder, format)
- split, substring으로 문자열 분리
- String의 startsWith(), endsWith()
- indexOf(), lastIndexOf()으로 문자열의 위치 찾기
- List에 특정 문자열이 있는지 확인
- forEach 사용 방법
- Runnable과 Callable의 차이점
- Float을 Byte 배열로 변환, Byte배열을 float으로 변환
- BufferedReader, BufferedWriter
- Generics에서 Covariance, Contravariance 개념
- getPath(), getAbsolutePath(), getCanonicalPath() 차이점
- Gson으로 Java -> JSON Object 변환
- Thread.join()
- Thread 우선순위(Priority)를 설정
- throw와 throws의 차이점
- Timer
- Try-with-resources
- Lambda, 익명 클래스에서 final 변수를 참조해야하는 이유
- Generics
- Reflection
- 정규표현식(regex)
Java 8
Collection
- ArrayList.add()
- ArrayList.addAll()
- ArrayList.clear()
- ArrayList.clone()
- ArrayList.contains()
- ArrayList.forEach()
- ArrayList.get()
- ArrayList.indexOf()
- ArrayList.lastIndexOf
- ArrayList.remove()
- ArrayList.removeAll()
- ArrayList.removeIf()
- HashSet
- HashSet.add()
- HashSet.remove()
Map
Concurrency
File
- 텍스트 파일 생성 방법
- 텍스트 파일을 읽는 방법
- 파일에 문자열 쓰기
- 파일 rename, move
- 특정 경로에 파일 생성
- 하위 폴더, 파일 모두 삭제
- 디렉토리(폴더), 파일 크기 계산
- 파일에서 확장자(File extension) 얻기
Date
- 현재 날짜, 시간 가져오기
- 현재 시간, 날짜를 원하는 형식으로 출력
- Date에 년, 월, 일을 더하고 빼기
- String을 파싱하여 LocalDate로 변환
- Milliseconds를 Hours, Minutes, Seconds 단위로 변환
- 시간(Time), 날짜(Date) 비교
- ZonedDateTime을 TimeStamp로 변경
- LocalDateTime을 TimeStamp로 변경
Utils
Tips
Examples
- Map을 List로 변경
- Set를 List로, List를 Set로 변환
- 현재 작업 디렉토리(Working directory)
- 문자열(String)에서 숫자(int)만 추출
- Random number(난수) 생성
- 두개의 List를 하나로 합치기
- 특정 디렉토리의 파일 리스트 탐색 및 출력
- 거듭제곱 계산, Math.pow()
- 제곱근(root) 계산, Math.sqrt()
- 간단한 HashTable 구현
- Map을 정렬(sorting)하는 방법
- 배열 정렬(Sorting)
- 문자열(String)을 비교
- 문자열(String) 길이 계산
- String.matches()로 문자열 패턴 확인
- 대소문자 변환, 구분없이 비교
- System.identityHashCode()와 hashCode()의 차이점
- Thread 생성, 실행, 정지