employer cover photo
employer logo
employer logo

RPM Technologies (Canada)

Est-ce votre entreprise ?

Question d’entretien chez RPM Technologies (Canada)

Write a Java program to throw and catch an exception.

Réponse à la question d'entretien

Utilisateur anonyme

14 avr. 2012

public class A{ public int a=5; try{ go() { a=5/0; } } catch(ArithmeticException a) { system.out.println("exception caught") } public static void main(Strings[] arg) { A a1=new A(); a1.calc(); system.out.pritln("after exception"); } }