//Java Program: Copy File Using FileInputStream and FileOutputStream import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class FileCopyExample { public static void main(String[] args) { // Define source and destination files File sourceFile = new File("source.txt"); File destFile = new File("destination.txt"); // Use try-with-resources to ensure streams are closed automatically try (FileInputStream fis = new FileInputStream(sourceFile); FileOutputStream fos = new FileOutputStream(destFile)) { byte[] buffer = new byte[1024]; int bytesRead; // Read from source and write to destination while ((bytesRead = fis.read(buffer)) != -1) { fos.write(buffer, 0, bytesRead); } System.out.println("File copied successfully!"); } catch (IOException e) { System.out.println("Error occurred: " + e.getMessage()); } } }/* line count if (byteRead == '\n') { lineCount++; } */ /* word count if (Character.isWhitespace((char) byteRead)) { wordcount++; } */ /* char ch = Character.toLowerCase((char) byteRead); if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') { vowelCount++; */