Thursday, February 26, 2009

sorce code checkedExceptions



//example to demonstrate checked exceptions
package exceptions;

public class Checked {
public static void main(String arg[])
{
//if any code which is possible to write checked exception
//compiler will not allow you with out try catch or throws

Thread.sleep(100); //error
//unhandled exception type interruptedexception
}
}



0 comments:

Post a Comment