rendered paste body/** Class FileOp* By Rune Vikestad* E-Mail vikestad@stud.ntnu.no* Web http://folk.ntnu.no/vikestad/* Description IT-1103, Basic Programming (Java), Exercise 6*/import java.io.*;import java.util.*;import javax.swing.JOptionPane;/*** Class: 'FileOp'*/public class FileOp { /** * Method: 'main'. */ public static void main(String[] args) throws IOException { /* * Variable Declarations */ String fileInName; String fileOutName; File fileIn; File fileOut; FileReader fr; FileWriter fw; BufferedReader br; PrintWriter pw; StringTokenizer st; String a, str; /* * Initiate Variables */ fileIn = new File("file.in"); fileOut = new File("file.out"); fileInName = "file.in"; fileOutName = "file.out"; fr = new FileReader(fileInName); fw = new FileWriter(fileOutName); br = new BufferedReader(fr); pw = new PrintWriter(fw); a = br.readLine(); /* * Start processing the 'in' stream .. */ try { while((a = br.readLine()) != null) { /* Print tokens */ st = new StringTokenizer(a); while (st.hasMoreTokens()) { str = st.nextToken(); System.out.println(str); pw.println(str); } } } finally { /* Close both streams */ br.close(); pw.close(); } }}