Java – determines whether static methods are purely functional

Given a Java lang.reflect. Method object, regardless of whether the method is a pure function (that is, given the same input, it always produces the same output, it is stateless, in other words, the function does not depend on its environment)?

Solution

No, no way

Reflection does not allow you to examine the actual code behind the method

Even where possible, actual analysis can be... Tricky, at least

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>