Wednesday, 29 August 2012

java program for command line arguments

class CmndLineArguments {

    public static void main(String[] args) {
        int length = args.length;
        if (length <= 0) {
            System.out.println("You need to enter some arguments.");
        }
        for (int i = 0; i < length; i++) {
            System.out.println(args[i]);
        }
    }
}

No comments:

Post a Comment