Exception Handling in Java — a practical guide to Java exception handling with clear examples you can reuse in real projects.
Java Tutorial Series (46/90). Prefer one article? Read the complete Java tutorial.
Short description
Checked vs unchecked exceptions matter in Java APIs. Handle or declare checked exceptions.
try/catch
try {
int n = Integer.parseInt("abc");
} catch (NumberFormatException e) {
System.out.println("Invalid number");
}