I figure if I give myself a little challenge every couple of days, eventually this JAVA stuff will start sinking in
I'm working on a program that will compare two lists. For now I am trying to get familiar with JAVA altogether.
I've written this code with the primary objective to get more familiar with fileWriter and fileReader. Basically, what I want it to do for the time being is to take my two arguments (which will be the name of the read file and the name of the write file), and have the readFile read the file at my first arguement and have writeFile write an arbitrary file that is named after my second argument.
It compiles but does not like it when i run it with arguements
ex:
java listCompare ss.txt 1sttry.txt
Exception in thread "main" java.lang.NoClassDefFoundError: ss/txt
here's my code:
import java.io.*;
public class listCompare
{
public static void main(String []args)
{
//arguments that tells us what is being compared ot what
String Base = args[0];
String Compare = args[1];
//read base file and load it to a string
try
{
FileReader baseFile = new FileReader(Base);
BufferedReader buffer= new BufferedReader (baseFile);
//String holdFile= baseFile;
FileWriter newFile = new FileWriter(Compare);
buffer.close();
}
catch (IOException e) { System.out.println(e);}
}
}
Thanks
JN