Question: I need to understand how this program class Test { String str = a; void A() { try { str +=b; B(); } catch (Exception

I need to understand how this program

class Test

{

String str = "a";

void A()

{

try

{

str +="b";

B();

}

catch (Exception e)

{

str += "c";

}

}

void B() throws Exception

{

try

{

str += "d";

C();

}

catch(Exception e)

{

throw new Exception();

}

finally

{

str += "e";

}

str += "f";

}

void C() throws Exception

{

throw new Exception();

}

void display()

{

System.out.println(str);

}

public static void main(String[] args)

{

Test object = new Test();

object.A();

object.display();

}

}

- java-

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!