Replacement.java:3: cannot find symbol
symbol : class regex
location: package java.util
import java.util.regex;
^
nirjari patel wrote:Does it mean that I can not modify the existing files without creating new files ?
nirjari patel wrote:Is there a way to store all the lines in an arraylist and write entire arraylist to the file ?
with br.readLine(), I can read one line at a time and with br.read(), I can read one character at a time. How can I read entire file at once rather than reading line by line ?
nirjari patel wrote: But when I execute this code the output file is blank. What should I do in the code to get output in the file ? Can you please provide me with a sample code, how to read from a file, make change in the content and write the whole file to a new file ?