|
-
Mar 10th, 2003, 04:36 PM
#1
Thread Starter
Addicted Member
args[0] == "literal"
I'm taking arguments from the command line, and I'm comparing them in if else statments to find certain arguments.
Example:
java myProg -arg1 subArg
then I'll have for (int i=0; i<args.length; i+=2) {
if (args[i] == "-arg1") { do something } else if (...
else { defualt something }
I always get the default something. args is a String array in my main method call. Problem comparing string literals with string array?
NOMAD
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
|