Runtime Time Exception Example
public class DefaultExceptionHandling{
public void division()
{
int num1 = 10,num2 = 0;
System.out.println(num1 + "/" + num2 + " = " + ( num1 /num2 ));
System.out.println("Returning from division");
}
public static void main(
String args[]){
new DefaultExceptionHandling().division();
}
}
Compile time Exception Example
import java.io.*;
public class Baseclass{
public void method() throws IOException{}
}
class IllegalOne extends Baseclass{
public void method() throws Exception{}
}
I hope these examples will clear ur doubt
Regards
Ashish