Java and C#
May 24, 2005 @ 08:02 AM
using System;
public class CommandLine {
public static void Main(string[] args) {
Console.WriteLine("Number of command line parameters = {0}", args.Length);
for (int i = 0; i < args.Length; i++) {
Console.WriteLine("Arg[{0}] = [{1}]", i, args[i]);
}
}
}
Java Code:
public class CommandLine {
public static void main(String args[]) {
System.out.println("Number of command line parameters = " + args.length);
for (int i = 0; i < args.length; i++) {
System.out.println("Arg[" + i + "] = [" + args[i] + "]");
}
}
}
Also, ignore the \’s in front of quotes. WordPress seems to want to add them in front of quotes inside <pre> tags, and I don’t care to figure out why at the moment.