|
-
November 16th, 2015, 06:01 AM
#1
ECollege Question
I have a problem with a Java question on my ECollege course: Here it is:
In the programs you have encountered so far you will have seen the main method used something like this: public static void main(String[] args)
The args part of the program can accept values (parameters) when the program is called (run). Write a Java program called ShowArgs using Using Notepad++ or another plain code editor. This java program should accept two command line arguments when you are running the program. It should then output these arguments.
Note: You will need to research outside of the course contents to complete this part of the assignment. Include comments to show that you understand fully what the program is doing
Compile and run this .java source code from a command line. Place the command line arguments as words after the program name when you are running it with spaces between them as in apples and oranges below.
Example:
javac ShowArgs.java
java ShowArgs apples oranges
apples oranges
Upload the ShowArgs.java source code that you used at the command line and a screenshot of the program being compiled and run from the command line. Any of the popular image formats will be accepted for the screenshot. Please keep the file name of the screen shot short.
How do I work it
-
November 16th, 2015, 06:29 AM
#2
Re: ECollege Question
What have you tried? What java programming problems are you having?
Norm
-
November 16th, 2015, 08:28 AM
#3
Re: ECollege Question
 Originally Posted by Norm
What have you tried? What java programming problems are you having?
I'm using Java 7 through Netbeans, I'm unsure of how to proceed....
-
November 16th, 2015, 08:52 AM
#4
Re: ECollege Question
Start by defining a class and adding a main method to it. Add a println() statement to the main method that prints a message.
See the tutorial: http://docs.oracle.com/javase/tutori.../netbeans.html
Norm
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|