Variable Arguments(Varargs) : varargs allows a method to accept zero or more arguments, No need to specify how many number of arguments will be passed to a method.
Syntax : access_specifier return_type method_name(data_type... variable_name){}
Below example demonstrate two methods with varargs.
No comments:
Post a Comment