This is a small Java Program that counts the words in a text file. However, unfortunately, it's not very good! What a shame.
Take an hour or two and make some improvements, and then zip the folder up and send it to the recruitment team you are in contact with.
To get startet with eclipse, run
gradlew eclipse
in the root directory, this will generate the eclipse project files.
Well, it's up to you - but anyhow, here are some suggestions where to start:
- All code is in a single class and in a single method. Can you restructure it?
- The code does not use generics, can you add type safety?
- The code was written by a naughty developer who didn't write any unit tests. Can you improve that?
- Maybe the code could be simplified using the Guava library and/or new Java features?
- The word extraction isn't very robust. How can you make it better?
- What other methods could you use to input data to the program?
- The output is not very nice, can you improve it?
Your code should compile and run on a Windows environment with Java 8. If your set up is any different, do let us know!
Good luck, and may the wordcounts be with you.