File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception code.

 
Ritesh raushan
Ranch Hand
Posts: 100
  • 0
  • 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
Pie
Posts: 47253
52
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint : first think about java exception catching order.
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 2878
59
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of inheritance...

Exc0 e0 = new Exc1();
 
Campbell Ritchie
Sheriff
Pie
Posts: 47253
52
  • 0
  • 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