wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Using Main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using Main" Watch "Using Main" New topic
Author

Using Main

Benjamin Thomas
Greenhorn

Joined: May 16, 2011
Posts: 1
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.

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2153
    
    7
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38020
    
  22
And welcome to the Ranch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Main
 
Similar Threads
Use of ResourceBundle for properties
Problem in File lock using Threads in java
Why Null Pointer Exception?
Cannot find symbol method close(java.io.BufferedReader)
File lock using Threads in java