Write a program RecursiveLoop
that has a static method loop()
that takes two parameters: an int n
and an int endValue
. In that static method, if n < endValue
the program should print the value of n
and call the loop
method again, recursively, with parameters of n + 1
and the same endValue
. If n == endValue
, just return.
Your program should have a static main()
method that demonstrates calling the recursive function loop()
.