contoh penggunaan throw di javacontoh penggunaan throw di java

Kamis, 25 November 2010

contoh penggunaan throw di java


class contoh_throw {
public static void main(String[] x) throws Exception {
try {
throw new Exception ("Hasil tidak terdefinisikan!");
}catch(Exception e) {
System.out.println("Proses dihentikan, pembagi=0");
throw e;
}
}
}

Tidak ada komentar:

Posting Komentar