This should help you start..
import java.io.File;
import java.util.Scanner;
public class WordFinder {
/**
* JavaProgrammingForums.com
*/
public static void main(String[] args) {
System.out.println("Enter word to find: ");
Scanner sc = new Scanner(System.in);
String word = sc.next();
readFile(word);
}
public static void readFile(String word) {
// Location of file to read
File file = new File("data.txt");
// File reading code
}
}
Tale a look at:
http://www.javaprogrammingforums.com...ner-class.html