Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, December 3, 2007

java code for Throwing Exceptions From Methods



Throwing Exceptions From Methods



Throwing Exceptions From Methods


<%!
void doWork() throws ArrayIndexOutOfBoundsException {
int array[] = new int[10];
array[100] = 100;
}
%>

<%
try {
doWork();
} catch (ArrayIndexOutOfBoundsException e) {
out.println("Array out of bounds exception");
}
%>

No comments: