Jump to content

Command-line arguments: Difference between revisions

(LSE64)
Line 108:
[[Category:Java]]
 
public class argumentsArguments {
public static void main(String[] args) {
System.out.println("There are " + args.length + " arguments given.");
for(int i = 0; i < args.length; i++)
System.out.println("The argument #" + (i+1) + " is " + args[i] + "and is at index " + i);
}
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.