This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've used text files to store data about students
each line consists of student name, SSN, and score
This is the problem:Given SSN, search into the file and if you find matching read the current line from beginning to display such output
John F Smith:50.5
I've developed this class
but when the matching occur i cannot read the the current line from beginning
Can you help me in this???
I Hear I Forget, I See I Remember, I Do I Understand.
I would read the file line by line rather than use a Scanner. Look for the match in each line, and if you find one, you already have the line in a String variable. Also, you don't waste time trying to match an SSN with the other tokens, which may be names or scores.