You are where you were several posts ago. Same code, same errors, different method names. Short of writing this for you, I'm not sure how to reboot you so that you start rethinking what you're...
Type: Posts; User: GregBrannon
You are where you were several posts ago. Same code, same errors, different method names. Short of writing this for you, I'm not sure how to reboot you so that you start rethinking what you're...
Something more like this:
public static void main(String args[])
{
// i think you have M and N backwards, but I may not understand your comments
int M =...
I suggest falling back and regrouping with a minor rethink, starting with the requirements. Sometimes we get set on a programming course not recognizing that we've either set out in the wrong...
You've analyzed the source of the error correctly: can't cram 10 pounds into a 5 pound sack. I also think the two arrays hold different types of data, and that's a problem. And I agree with your...
Okay, but I'm not sure it's the right way. If args[] only contains two values M and N, and they've already been extracted and parsed to the desired values, I'm not sure why you'd pass the args[]...
As I said pretty clearly, the necessary values or the whole array itself could be passed to the method:
Change the call in main() to:
int[] vectora = readfromargs( N, args );
And change the...
The array args[] is local to the main() method, not within the scope of other methods even in the same class. Any values in args[] (or args itself) that are needed should be stored in other...
Give us example values for M and N.
Are you sure the program isn't just waiting for data entry from the keyboard? Have you tried entering values after running? It might be helpful to add a...