How to pass elements of an arrayList to variadic function

前端 未结 3 1603
长情又很酷
长情又很酷 2020-12-11 00:23

I\'ve got an arrayList filled with elements. I would like to pass the elements of that array list as arguments to a variadic function.

My function

p         


        
3条回答
  •  無奈伤痛
    2020-12-11 01:07

    I always create an overload that takes Iterable< ? extends IEntityModifier >, and make the variadic version forward to this one using Arrays.asList(), which is cheap.

提交回复
热议问题