Automatic boxing should be avoided in Java

I'd like to ask if automatic boxing should be avoided in Java Because some methods need a primitive type "double", but pass a "double" object as a parameter, this should be avoided because the compiler will open the object you pass and may be heavy?

Solution

This is what Java notes said on autoboxing:

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