When implementing a java function to accept arbitrary number of arguments, what will be the right way of doing that?
In python, i will do
def sumUp(*args):
res = 0
for arg in args:
res = res + arg
return res
sumUp(12,1) # return 13
sumUp(12,8,6) # return 26
Is there something in java closely equivalent to this without having to pass in a list argument? And what about **kwargs?