05-08-2010, 07:43 PM
Ok so this is a really n00bish question but i cant seem to find an answer for this.
Here is my source code:
I went to Run>Set Project Configuration>Customize and changed the argument to 169. I ran the file and it gives me the output of
My question is why is it not taking the argument of 169 instead of evaluating 100? I checked the length of the argument and its 3. Any help would be appreaciated. Dont be to harsh im still begining Java.
Here is my source code:
Code:
class NewRoot {
public static void main(String[] args){
int number = 100;
if (args.length > 0) {
number = Integer.parseInt(args[0]);
}
System.out.println("The square root of "
+ number
+ " is "
+ Math.sqrt(number));
}
}
Code:
The square root of 100 is 10.0
My question is why is it not taking the argument of 169 instead of evaluating 100? I checked the length of the argument and its 3. Any help would be appreaciated. Dont be to harsh im still begining Java.