Java – why does a function not have a parameterized return type because it has parameterized input?

This always forces us to return one parameter in case I need to return multiple, such as a list and a string There is no such restriction in function arguments

Solution

This problem is a problem that functional languages such as f#, Haskell try to solve The problem is that in hardware, the return value of a function is initially returned through the CPU register, so you can only return a single value The legacy C syntax and C (and c#, Java) also inherit this

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
分享
二维码
< <上一篇
下一篇>>