Home / Java Tips Generated By ChatGPT / Basic Exception Handling in Java Always catch specific exceptions to handle known error conditions gracefully. Source Code try { int result = 10 / 0; } catch (ArithmeticException e) { System.out.println("Cannot divide by zero!"); }