var-arg method (variable number of argument method )
- Until 1.4 we can't declare a method with the variable number of arguments.If there is a change in the number of arguments compulsory we should go for the new method.But this increases the length of the code & readability.
- To overcome this problem java makers introduced the var-args method in 1.5 version of JDK(java).According to this, we can declare a method which can take the variable number of arguments, such type of method are called var-arg methods.
- we can declare a var-arg method as follows:-