Tuesday, October 18, 2005

usage of String args[]

Inputting from command line (usage java Main <argument1> <argument2> …   )

 

public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("test");
        for(int i=0; i<args.length; i++)
        {
            System.out.println("testing input "+args[i]);
        }
    }
}

 

 

Pradyut
http://pradyut.tk
http://spaces.msn.com/members/oop-edge/
http://groups-beta.google.com/group/oop_programming
India

 

No comments: