Equivalient method overload why necessary?

前端 未结 3 1137
甜味超标
甜味超标 2021-01-18 00:32

I browsed some JAVA code made by Google, and I found the ImmutableSet: http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableSet.html

3条回答
  •  逝去的感伤
    2021-01-18 00:39

    Performance. In order to call the E... version of the method, the caller must allocate a new array. The caller only has to push the args on the stack to call the other methods.

提交回复
热议问题