Aim:- Refine the student manager program to manipulate the
student information from files by using the BufferedReader and BufferedWriter.
import java.lang.*;
import java.io.*;
public class pra12 {
public static void
main(String[] args) throws Exception {
BufferedReader
bufRead = new BufferedReader(new FileReader("a.txt"));
BufferedWriter
bufWrite = new BufferedWriter(new FileWriter("ab.txt"));
int i;
do {
i =
bufRead.read();
if (i !=
-1) {
if
(Character.isUpperCase((char) i)) {
bufWrite.write(Character.toLowerCase((char) i));
}
else {
bufWrite.write((char) i);
}
}
} while (i !=
-1);
bufRead.close();
bufWrite.close();
}
}
Output:-
No comments:
Post a Comment