This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Factorial Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Factorial" Watch "Factorial" New topic
Author

Factorial

Adam Blais
Greenhorn

Joined: Dec 02, 2004
Posts: 27
How do you compute factorials in java without making a loop for the number?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
You could use recursion instead. If you don't know what I mean by this, then google for "recursion" or look it up in the index of your textbook.

Layne


Java API Documentation
The Java Tutorial
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Factorial
 
Similar Threads
design pattern for Strings to Objects
WA #1.....word association
Pattern decision
What is the need for a pattern like factory Pattern?
Abstract Factory pattern