5th sem OOPJ Create a class called Student. Write a student manager program to manipulate the student information from files by using BufferedReader and BufferedWriter.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
*
* @author Yash
*/
public class pra12 {
public static void main(String arg[]) throws FileNotFoundException, IOException{
BufferedReader br = new BufferedReader(new FileReader("new.txt"));
BufferedWriter bw = new BufferedWriter(new FileWriter("output.txt"));
int i;
do{
i=br.read();
if(i != -1){
if(Character.isUpperCase((char)i)){
bw.write(Character.toLowerCase((char)i));
}else{
bw.write((char)i);
}
}
}while(i != -1);
br.close();
bw.close();
}
}
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
*
* @author Yash
*/
public class pra12 {
public static void main(String arg[]) throws FileNotFoundException, IOException{
BufferedReader br = new BufferedReader(new FileReader("new.txt"));
BufferedWriter bw = new BufferedWriter(new FileWriter("output.txt"));
int i;
do{
i=br.read();
if(i != -1){
if(Character.isUpperCase((char)i)){
bw.write(Character.toLowerCase((char)i));
}else{
bw.write((char)i);
}
}
}while(i != -1);
br.close();
bw.close();
}
}
Comments
Post a Comment