All pastes #771029 Raw Edit

Stuff

public java v1 · immutable
·published 2007-11-12 19:32 UTC
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;		/*		* 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()) {					a = st.nextToken();					System.out.println(a);					pw.println(a);				}			}		} finally {				br.close();				pw.close();		}	}}