I have absolutely no experience in Java and am being thrown into the fire right now. I was hoping someone could be so kind as to help me write a method so I can learn from it and extrapolate. My task is basically as follows, and I really appreciate any and all help.
Thanks so much,
I have to write a main method that reads in a set of strings from the command line, determines how many strings from the command line match the first string from the command line, and then prints out the first string entered at the command line and the number of times it was repeated in the set of strings entered at the command line.
Secondly, we have a couple policies that we follow. One is DoYourOwnHomework. This sounds supsiciously like a homework question. A couple more policies are ShowSomeEffort and NotACodeMill. We are more than happy to help, we just won't do the work for you.
Here are my recommendations:
1. Break down your problem into small parts, and work out by hand in plain English how to accomplish this task.
2. Read the Java Tutorial on Sun's site, and do some googling to find out the basics of reading from the command line, looping, and printing in Java.
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
the most important thing is to write your code in as small a chunk as you can before you compile, test, and debug. It is an extremely iterative process. Your first iteration should be something like this:
Once you test and debug this, you can take out that println statement, and put in more code...like printing out the first string from the args array. do as little as possible each time you re-compile.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors