Explain var args in java with example

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Explain var args in java with example

This tutorial explains what is var args and how to use varargs method in java?
http://java-interview-questions.com/explain-var-args-method-with-example
  • Total Hits: 7007

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 10 votes

  • Category: JAVA/Core JAVA

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

  • Submitted By: jessie

  • Set as Favorite

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    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 30%  3
 Two starsTwo star  Vote LeftVote MiddleVote Right 10%  1
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 10%  1
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 30%  3
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 20%  2

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.






Advertisements