This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Program Logic.  RSS feed

 
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
Posts: 12440
42
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
Posts: 20893
81
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
Boost this thread!