1
JavaBeginner#strings
Checked exceptions extend Exception (not RuntimeException) and must be declared or handled — e.g., IOException. Unchecked extend RuntimeException — e.g., NullPointerException — and are not enforced by the compiler.
void readFile() throws IOException { // checked, must declare
new FileReader("a.txt");
}
int[] arr = new int[2];
arr[5] = 1; // ArrayIndexOutOfBoundsException, unchecked