DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Java Var Args

09.26.2009
| 1851 views |
  • submit to reddit
        // description of your code here
// A simple method to process variable arguments in java
	public static void printVarArgs (int ... ints)
	{
		System.out.println(ints.length);
		
		System.out.println(ints[1]);
		
		for (int i : ints)
		{
			System.out.println(i);
		}
	}