language java!

3. Exceptions (3 pts) Write the output of this code in the box below. class ExceptionTest { String str = a; void secondMeth 3. Exceptions (3 pts) Write the output of this code in the box below. class ExceptionTest { String str = “a”; void secondMethod() throws Exception throw new Exception(); { void firstMethod() { try void display() { { System.out.println(str); secondMethod(); str +=”b”; catch (Exception e) str += “c”; public static void main(String[] args) { ExceptionTest object = new ExceptionTest(); object.firstMethod(); object.display(); finally { str += “x”; Output:



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *