• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception code.

 
Ritesh raushan
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what is the output of this program and how please explain .





 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don’t simply answer such questions. Please explain what you think the output is, and we shall say whether we agree.
You must also tell us where the question comes from.
 
Buddhika Mawella
Ranch Hand
Posts: 40
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint : first think about java exception catching order.
 
Matthew Brown
Bartender
Posts: 4565
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, the best way to find out for certain what the output is (once you've thought about what you think it should be) is to actually compile and run the code.
 
Ritesh raushan
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ouput is (Ex0 caught) but i didn't understand how did.
 
Tony Docherty
Bartender
Posts: 2939
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did you expect it to be and why?
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of inheritance...

Exc0 e0 = new Exc1();
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gaurangkumar Khalasi wrote:Because of inheritance...

Exc0 e0 = new Exc1();
Correct. What you need to do is follow the path of execution, with a pencil on the code. You should be able to confirm that easily.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic