employer cover photo
employer logo
employer logo

RPM Technologies (Canada)

Is this your company?

RPM Technologies (Canada) interview question

Write a Java program to throw and catch an exception.

Interview Answer

Anonymous

14 Apr 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"); } }