Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I've never programmed before in Java, actually I've never programmed, period. I'm attempting to teach myself. I was looking at the HelloWorld program below: // A simple program to print out the string "HelloWorld". public class HelloWorld /* Applications always execute the main method of @param args[] contains the command line arguments. public static void main(String args[]) } Suppose I wanted the program to echo the number of runtime arguments. For instance, if I type java HelloWorld this is a test What if I wanted the program to echo the factorial of the number of arguments to the program. For instance, if I type java HelloWorld this is a test the output should be 24 (= 4 x 3x 2 x 1), which is the factorial of 4. What changes would I have to make to the above code. I tried the following but it gives a blank answer: /*A simple program to echo the number of runtime public class HelloWorld
Replies:
|
Sponsored Links
|