This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: main. The String args is an array of strings! But so far, we did not use command line inputs. Since arrays (in this context) start with an index of zero (0), to get to the first input argument, namely, Felius_T_Schmuck, symbolically referred to as arg, wed say: String name; name = args; and the input string is assigned to name. args references the first command line input after the file name to be executed. For the integer, wed have to say: int age; age = Integer.parseInt (args); This takes the second string input and converts it to an integer (you know this) and assigns it to an integer variable, age. If there were three command line inputs, the next one would be referred to as args, and it might or might not have to be converted internally depends if it is a string (no conversion) or a numeric type some conversion to integer, float, double, char, etc. Got it? Hope so. Good luck....
View Full Document
This note was uploaded on 07/26/2011 for the course COP 2551 taught by Professor Roggio,r during the Summer '08 term at UNF.
- Summer '08