hi could u'll plz help me!

hi!am new to java.i need a program for this first of all to read all the data from a file n print the duplicate words in it for example:if the word "hello" is repeated in a file thrice that is in lines 10,20,30.i need to print as hello 3 [10,20,30]
[290 byte] By [Nalini_99a] at [2007-10-3 6:40:44]
# 1
And your question is?
prometheuzza at 2007-7-15 1:29:40 > top of Java-index,Java Essentials,New To Java...
# 2

Do you want help, or a code dump?

Do you know how to read a file? If not [url=http://java.sun.com/docs/books/tutorial/essential/io/index.html]The Java?Tutorials > Essential Classes: Basic I/O[/url]

[url=http://www.catb.org/~esr/faqs/smart-questions.html#bespecific]How To Ask Questions The Smart Way: Use meaningful, specific subject headers[/url]

mlka at 2007-7-15 1:29:40 > top of Java-index,Java Essentials,New To Java...
# 3
First of all you need name for your class - did you choose one?
Michael.Nazarov@sun.coma at 2007-7-15 1:29:40 > top of Java-index,Java Essentials,New To Java...
# 4

HashMap is the data structure you are looking for.

http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html

You can have each word(which you read from the file) as the key and the number of times it is repeated as the value of your Map.

Whenever you have a word you can get the value of the word(key) from the Map.

If the value is null, set the value for the word as 1 in the Map.

Else, increment the value by one and set the new value for the corresponding key.

Thanigaivel.Ma at 2007-7-15 1:29:40 > top of Java-index,Java Essentials,New To Java...