File
package java.io.File;
- 파일의 이름과 디렉토리 이름의 추상적 표현
getAbsolutePath()
: 생성한 파일 객체에 대한 절대 경로를 찾는다.
Paths
package java.nio.file;
- 문자열로 된 경로 또는 URI 객체를 받아
Path
객체를 반환하는 정적 메서드로만 구성되어 있다
Path
package java.nio.file;
- 파일을 찾는데 사용되는 경로 객체
FileReader vs Scanner
- FileReader
- BufferedReader 등의 보조스트림을 이용해서 읽기 성능을 높일 수 있다
- Scanner
- 파일을 읽을 때 정규식을 활용하므로(ex. 공백 기준으로 읽기) 속도가 느리다
ClassLoader
- 자바는 어플리케이션이 실행될 때 메모리에 클래스를 올린다
- 어플리케이션에 동작하는데 필요한 클래스들을 메모리에 올리는 작업을 수행해주는 것이
ClassLoader
이다
ClassLoader
덕분에 JVM 은 어떤 클래스가 필요한지 파악하지 않아도 된다