Showing posts with label var-arg Method. Show all posts
Showing posts with label var-arg Method. Show all posts

Java - varargs Method / Chapter - 6 /Language Fundamental (1.5v)



java varargs





var-arg method    (variable number of argument method )




  1. 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.

  2. 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.

  3. we can declare a var-arg method as follows:-

Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com