i'm a bit rusty with java, what i want to do is from the CLI, launch the app and using an argument (add/remove) add two strings into an array.
i've not given any thought to the array side of things as i know what im doing there, what im not sure is how to handle the arguments.
i know that that will echo any arg i pass it, but if i say gave it "echo hello you smell", it would treat each arg as a new string, and echo it on a new line. What i don't know is how to take each string and copy it into a string within my code.
Am i making sense here?
i've not given any thought to the array side of things as i know what im doing there, what im not sure is how to handle the arguments.
Code:
public class Echo {
public static void main (String[] args) {
for (String s: args) {
System.out.println(s);
}
}
}
i know that that will echo any arg i pass it, but if i say gave it "echo hello you smell", it would treat each arg as a new string, and echo it on a new line. What i don't know is how to take each string and copy it into a string within my code.
Am i making sense here?