Does Java 8 have tail call optimization?

点点圈 提交于 2019-11-29 01:32:58

As far as I know Java 8 does not have tail call optimization. Afaik it isn't related to the actual compiler trick, because that one is simple, but to preserve a callstack for security purposes. But I guess it would be possible with a bytecode rewriter.

Java does not support TCO at compiler level but it is possible to implement it with Java 8 using lambda expressions. It is described by Venkat Subramaniamin in "Functional Programming in Java".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!