I am a Java beginner struggling with the transition to OO programming. Or, at least I think that's why I am struggling. I worked my way through a few Java books and not much stuck. Now I am working my way through an old Python book, but forcing myself to accomplish all of the tasks using Java instead of Python. The hope is that this will force me to work through problems and ask questions rather than simply copying code from the book. Anyway, my problem is as follows. I need to accomplish a few very simple tasks. I need to read a list of comma-delimited times in from a file, format the times, remove duplicates, and print the three fastest times. Oddly enough, I think that I have a pretty good handle on the methods required to make this happen. I'm just at a loss as to how to call any methods after the first one. This is what I have:
As you can guess, this code performs the first method ( loadFile ) perfectly and I print all of the times twice; first as they appear in the file and second after they have been cleaned up. What I cannot grasp is how to get the returned String normTimes into the second method doTree, or how to call that second method. I know this is probably a fairly stupid problem to have and I fear that I am in the odd spot of understanding some more complex parts of Java while not understanding the very simple ones. Anyway, any advice would be appreciated. Advice with explanations would be extremely helpful.