Java > Learning sample source codes
Catching an exception
Catching an exception package com.ack.learning; public class CatchingAnException { public static void main( String[] args ) { try { // this throws a runtime exception, that is a divide by zero int a = 3 / 0; } catch( ArithmeticException aex ) { aex.printStackTrace(); } } }
Java Codes
Beginners
Core Java
Date Time
Java2D
Java Applets
Java AWT
Mathematics
Networking
Servlets
Session
Sound
Swing
Threads
Util Package
JDBC
Learning
Other
Security
XML