Category: JAVA Files

JAVA Program to Copy File in Uppercase 0

JAVA Program to Copy File in Uppercase

Follow me JAVA Program to Copy File in Uppercase: /* COPY FILE TO ANOTHER IN UPPERCASE */ import java.io.*; import java.lang.*; class filecopy3 { public static void main(String args[]) { BufferedReader br=null; BufferedWriter bw=null;...

JAVA Program to Copy Two Files Sequentially into Third File 0

JAVA Program to Copy Two Files Sequentially into Third File

Follow me JAVA Program to Copy Two Files Sequentially into Third File: /* COPY TWO FILES SEQUENTIALLY IN THIRD FILE */ import java.io.*; class filecopy2 { public static void main(String args[]) { FileInputStream i1=null;...

JAVA Program to Copy File Character by Character 0

JAVA Program to Copy File Character by Character

Follow me JAVA Program to Copy File Character by Character: /* CHARACTER BY CHARACTER COPY FILE*/ import java.io.*; class filecopy { public static void main(String args[]) { File i=new File(“png.txt”); File o=new File(“efg.txt”); FileReader...

JAVA Program to Replace Content of File 0

JAVA Program to Replace Content of File

Follow me JAVA Program to Replace Content of File: /* REPLACE OTHER WITH THE*/ import java.io.*; import java.lang.*; class file6 { public static void main(String args[]) { BufferedReader br=null; File f1=new File(args[0]); try {...

JAVA Program to Print File Content in Uppercase 0

JAVA Program to Print File Content in Uppercase

Follow me JAVA Program to Print File Content in Uppercase: /* CONVERT FILE CONTENT IN UPPERCASE */ import java.io.*; import java.lang.*; class file5 { public static void main(String args[]) { BufferedReader br=null; File f1=new...

JAVA Program to Write Data Character by Character in File 0

JAVA Program to Write Data Character by Character in File

Follow me JAVA Program to Write Data Character by Character in File: import java.io.*; class file4 { public static void main(String args[]) { File f=new File(“cde.txt”); FileWriter fw=null; try { fw=new FileWriter(f); int ch;...

JAVA Program to Read Data Character by Character from File 0

JAVA Program to Read Data Character by Character from File

Follow me JAVA Program to Read Data Character by Character from File: import java.io.*; class file3 { public static void main(String args[]) { File f=new File(“abc.txt”); FileReader fr=null; try { fr=new FileReader(f); int ch;...

JAVA Program to Read Data Byte by Byte from File 0

JAVA Program to Read Data Byte by Byte from File

Follow me JAVA Program to Read Data Byte by Byte from File: import java.io.*; class file2 { public static void main(String args[]) { FileInputStream fr=null; File f=new File(“abc.txt”); try { fr=new FileInputStream(f); int ch;...

JAVA Program to Insert Data in File Byte by Byte 0

JAVA Program to Insert Data in File Byte by Byte

Follow me JAVA Program to Insert Data in File Byte by Byte: import java.io.*; class file1 { public static void main(String args[]) { FileOutputStream fr=null; try { fr=new FileOutputStream(“abc.txt”); byte a[]={‘A’,’B’,’C’,’D’,’1′}; fr.write(a); } catch(Exception...

JAVA Program to Copy File Byte by Byte 0

JAVA Program to Copy File Byte by Byte

Follow me JAVA Program to Copy File Byte by Byte: import java.io.*; class cpyfile { public static void main(String args[])throws IOException { int i; FileInputStream f1; FileOutputStream f2; try { f1=new FileInputStream(args[0]); //Command Line...