•class NewRoot { // to
compute the square root of the first argument
• public static void main (String[] arguments) {
• if (arguments.length >
0)
• { int number = 0;
• number =
Integer.parseInt(arguments[0]);
•
System.out.println("The Square root of "
• + number
• + " is
"
• +
Math.sqrt(number));
• }
• else System.out.println("use: 'java NewRoot
[argument]'");
• }
•}
The formal parameter of the method main is a
one dimensional array of String's called arguments
containing the text typed after the name of the program
in the run command