2
2
.
.
1
1
.
.
3
3
E
E
x
x
c
c
e
e
p
p
t
t
i
i
o
o
n
n
s
s
I
I
n
n
f
f
o
o
This tutorial shows basic exception handling in Java.
Test.java
public class MyClass {
public static void main(String[] args) {
try {
Integer i = null;
i.byteValue(); //Throws Exception.
}
catch(Exception e) {
System.out.println(e.toString());
}
}
}