5th sem OOPJ Create a class called Student. Write a student manager program to manipulate the student information from files by using DataInputStream and DataOutputStream.
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
*
* @author Yash
*/
public class pra13 {
public static void main(String arg[]) throws FileNotFoundException, IOException{
DataInputStream din = new DataInputStream(new FileInputStream("new.txt"));
DataOutputStream dout = new DataOutputStream(new FileOutputStream("output1.txt"));
String str;
while((str=din.readLine()) != null){
String s2 = str.toUpperCase();
dout.writeBytes(s2 + "\n");
}
din.close();
dout.close();
}
}
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
*
* @author Yash
*/
public class pra13 {
public static void main(String arg[]) throws FileNotFoundException, IOException{
DataInputStream din = new DataInputStream(new FileInputStream("new.txt"));
DataOutputStream dout = new DataOutputStream(new FileOutputStream("output1.txt"));
String str;
while((str=din.readLine()) != null){
String s2 = str.toUpperCase();
dout.writeBytes(s2 + "\n");
}
din.close();
dout.close();
}
}
Comments
Post a Comment