Question: Write a recursive method replaceAll in the class RecStuff which will replace all occurrences of an old word with a new word in all files

Write a recursive method replaceAll in the class RecStuff which will replace all occurrences of an old word with a new word in all files with the suffix .txt in a given directory and in sub-directories of that directory (You are changing file contents). The signature for this method is as follows:

public static void replaceAll(String sPath, String sOldWord, String sNewWord)

can't use buffer reader and file reader and filewriter we use printwriter.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!