Understanding Varargs in Java: 2 Minute Guide For Non-Dummies

    Date: 04/30/06 (Java Web)    Keywords: no keywords

    Varargs allows variable number of arguments in methods and constructors. Let's start with a simple example. public static void main(String … args) {     for(String arg:args) {         System.out.println(arg);     } } Varargs can be thought of as an array with simplifications. A simple use case is: int sum(int… data) Key Points Method with varargs is called only when no other method signature matches the invocation. Only [...]

    Source: http://blog.taragana.com/index.php/archive/understanding-varargs-in-java-2-minute-guide-for-non-dummies/

« Akismet Plugin Update For... || How To Perfectly Align... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home