Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Java support tail recursion? [duplicate]

Possible Duplicate:
Why does the JVM still not support tail-call optimization?

I see so many different answers online, so I thought I'd ask the experts.

like image 605
Donald Taylor Avatar asked Dec 09 '10 17:12

Donald Taylor


1 Answers

There is difference between tail recursion and tail recursion optimization. Tail recursion is supported by java because there is nothing special in it, tail recursion optimization is not supported.

like image 135
Andrey Avatar answered Oct 19 '22 11:10

Andrey