Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 2

1.

Write a Java program to read first 3 lines


from a file.

2. Write a Java program to find the longest


word in a text file.

3. Write a Java program to append text to an


existing file

4. File Word Count Implement a code to


count the occurrences of each word in an
input file and write the word along with
corresponding count in an output file sorted
by the words alphabetically. (Hint : Use Map
as an intermediate collection)
Sample Input inputFile.txt
Manoj studies at VIIT
Mansi studied at VIIT
Sumedh studies at VIIT
Harish studied at VIIT
Anita studies at VIIT
Jayesh studies at VIIT
Sample Output D:>Java FileWordCount
inputFile.txt outputFile.txt outputFile.txt
Anita : 1 Harish : 1 Jayesh : 1 Manoj : 1
Mansi:1 Sumedh : 1
VIIT : 6 at : 6 studied:1 studies : 5

5. Use the Caesar cipher to encode and


decode messages stored in files (Encoding
and decoding)

You might also like