Popular posts from this blog
Practical 12: Refine the student manager program to manipulate the student information from files by using the BufferedReader and BufferedWriter
Program: import java.io.*; import java.util.*; class practical12 { public static void main(String pqr[]) throws Exception { BufferedReader bufRead = new BufferedReader(new FileReader("stdinfo.txt")); BufferedWriter bufWrite = new BufferedWriter(new FileWriter("newstdinfo.txt")); int i; // manipulate the student information from files do { i = bufRead.read(); if (i != -1) { if (Character.isUpperCase((char) i)) { ...
Practical 13: Refine the student manager program to manipulate the student information from files by using the DataInputStream and DataOutputStream. Assume suitable data
Program : import java.io.*; public class practical13 { public static void main(String args[]) throws IOException { DataInputStream dataIS = new DataInputStream(new FileInputStream("stdinfo.txt")); DataOutputStream dataOS = new DataOutputStream(new FileOutputStream("newstdinfo.txt")); // manipulate the student information from files String str; while ((str = dataIS.readLine()) != null) { String upper = str.toUpperCase(); System.out.println(upper); dataOS.writeBytes(upper + " ,");...

Comments
Post a Comment