FileDocCategorySizeDatePackage
VarArgsDemo.javaAPI DocExample809Sun Mar 07 10:35:14 GMT 2004None

VarArgsDemo

public class VarArgsDemo extends Object
VarArgsDemo - show 1.5 variable arguments
author
ian
version
$Id: VarArgsDemo.java,v 1.1 2004/03/07 16:35:13 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
private static voidline()

		System.out.println("--------------------------");
	
public static voidmain(java.lang.String[] args)

		process(System.out, "Hello", "Goodbye");
		process(System.out, 42, 1066, 1776);
		process(System.out, "Foo", new Date(), new Object());
	
static voidprocess(java.io.PrintStream out, java.lang.Object args)

		line();
		for (int i = 0; i < args.length; i++){
			out.println("Argument " + i + " is " + args[i]);
		}
	
static voidprocess(java.io.PrintStream out, int args)

		for (int i = 0; i < args.length; i++){
			out.println("Argument " + i + " is " + args[i]);
		}