DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVA
java recursion
public
static
long
factorial
(
int
n
)
{
if
(
n
==
1
)
return
1
;
//base case
return
n
*
factorial
(
n
-
1
)
;
}
Source by introcs.cs.princeton.edu #
PREVIOUS
NEXT
Tagged:
#java
#recursion
ADD COMMENT
Topic
COMMENT
Name
5+1 =
Submit