Pesa ndakisa ya programme ya traitement ya exception na Java
Tala ndakisa ya programme ya Java oyo ezali kolakisa ndenge ya kosimba exception: ```java public class ExceptionExample { public static void main(String[] args) { try { // Code oyo ekoki kobwaka exception int num = 10; int div = 0 oyo ezali; int ans = motango / div; System.out.println("Eyano ezali " + ans); } catch (ArithmeticException ae) { // Code mpo na kosimba ArithmeticException System.out.println("Exception ya arithmétique: Ekoki kokabola na zéro te"); } catch (Exception e) { // Code mpo na kosimba Exception mosusu nyonso System.out.println("Libunga esalemi: " + e.getMessage()); } finally { // Code oyo ekosala tango nionso, sans considération soki exception ebwakama System.out.println("Exception handling complete"); } } } ``` Na programme oyo ezali likolo, code oyo ezali na kati ya bloc `try` ezo surveiller pona ba exceptions. Soki exception moko esalemi, ekangami na bloc `catch` oyo ekokani. Na cas oyo, kokabola na zéro e déclenchaka `ArithmeticException` oyo ekangami pe esimbami na bloc ya liboso `catch`, oyo e imprimer message oyo elakisaka que erreur esalemaki. Bloc ya mibale `catch` ezali wana pona kokanga ba types misusu nionso ya ba exceptions oyo ekoki kosalema. Na suka, bloc `finally` ezali na code oyo ekozala toujours exécuté, sans considération soki exception ebwakama to te. Na cas oyo, e imprimer message oyo elakisaka que traitement ya exception esili.