• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Program Logic.

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is this program trying to do?

 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12098
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looks to me like it's creating an object, using that to create a second one, and then printing it out.

what do YOU think it's doing?
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may be thrown off because Exceptions extends Exception, but since you are not throwing any exceptions you can consider them to be just simple objects.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me have a go..

You are creating a new type of Exception and then "returning" that Exception (which is also throwable) from a method.

If you modify your program like so..

You could trace the call to the method e. So I think this might be one way of to determine how a certain method/constructor gets called in the execution of a program without exiting the normal flow of the program.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic