{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Command-line-arguments

Command-line-arguments - public static void main String...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 1 Command-line arguments The formal parameter to the main method: array of String objects public class Test { public static void main( String[] args ) {} } e.g. java Test simpson dilbert length will be 2
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 2 Command-line arguments: Example public class Names {
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public static void main( String args ) { System.out.println( args.length ); for( int j = 0; j < args.length; j++ ) { System.out.println( args[ j ] ); } } } java Names susan anita java Names 234 john arun java Names Output ?? COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 3 Command-line arguments: in Netbeans...
View Full Document

{[ snackBarMessage ]}