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
Get step-by-step solutions from verified subject matter experts
