This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Program Logic. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Program Logic." Watch "Program Logic." New topic

Program Logic.

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
What is this program trying to do?

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11923

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?

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Rob Spoor

Joined: Oct 27, 2005
Posts: 20193

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.

How To Ask Questions How To Answer Questions
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 378
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.

I agree. Here's the link:
subject: Program Logic.
jQuery in Action, 3rd edition