Two comments:
Add this line first thing in main method for ease of testing:
args = new String[] {"sl", "3"}; // hard code for testing
Don't hard code any numbers for array indexes....
Type: Posts; User: Norm
Two comments:
Add this line first thing in main method for ease of testing:
args = new String[] {"sl", "3"}; // hard code for testing
Don't hard code any numbers for array indexes....
Your code is trying to look at the first element. The array is empty.
Your code must test/check if that array is empty and do something besides get an error.
Where do you do that check? The answer...
Please post the full text of the error message.
Let me change my question:
Where do you check if there are any elements in the args array?
This error message says you are trying to look at...
Is there an error? Please post the full text of the error message.
What does that mean?
Are you able to execute the code and get the error messages that are generated?
Is there an error? Please post the full text of the error message.
Go read the last line of post #3
Have you solved the problem or do you have more questions?
Use the equals() method when comparing Strings. The == operator is for primitives.
Where do you test if there are any elements in the args array?