posted 21 years ago
Hi Steve
When you say 'compare', what exactly do you mean? Do you just want to check whether or not the values are the same, or are you interested in determining by how much they differ if they are not the same? Do you need to do any time arithmetic? (I am assuming these values represent times).
Firstly, you need to read the 2 values in from the text file. Have a look at the API docs for the following classes in the java.io package:
- File
- FileReader
- BufferedReader
These will enable you to read the contents of the file into memory. From there, the equals & equalsIgnoreCase methods of the java.lang.String class will perform a simple equality check for you. If you need more than that, you could write some code to parse the times as integers and compare them that way.
Hope this helps
Michael
"One good thing about music - when it hits, you feel no pain" <P>Bob Marley