Explain var args in java with example

Tutorials Shared by the Internet Community

Advertisements


Synopsis

This tutorial explains what is var args and how to use varargs method in java?

Statistics

  • Total Hits - 10331

  • Total Votes - 9 votes

  • Vote Up - 4 votes

  • Vote Down - 5 votes

  • Domain - java-interview-questions.com

  • Category - JAVA/Core JAVA

  • Submitted By - jessie

  • Submitted on - 2014-07-15 05:47:55

Description

varargs introduced in java from 1.5 which allows methods arguments to accept variable number of arguments.Before varargs were introduced variable number of arguments are handled as follows:

1) use variable versions of method ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements