how to copy content of one file to another...

PHOTO EMBED

Fri Jan 19 2024 18:56:56 GMT+0000 (Coordinated Universal Time)

Saved by @E23CSEU1151 #java

import java.io.*;
class D
{
    public static void main(String[] args) throws Exception
    {
        FileInputStream r= new FileInputStream("C:\\Users\\HP\\Desktop\\okay");
        FileOutputStream w= new FileOutputStream("C:\\Users\\HP\\Desktop\\boss");

        int i;
        while((i=r.read())!=-1)
        {
            w.write((char)i);
        }
        System.out.println("Data copied successfull");
    
}
}
content_copyCOPY