Sorry look that problem I am having I have created the necessary command but it is giving me a null pinter.
Here is the file
/**
* Written by: GFlexz
* Date : 23-02-2003
* Purpose : Accept file names and compare
* name if not a directory and writer to and fro
* of the file name.
*/
import java.net.*;
import java.io.*;
public class InputOutput extends Object{
public static void main (String[] args){
String first;
String second;
BufferedWriter write = null;
BufferedReader read = null;
BufferedReader in = new BufferedReader ( new InputStreamReader ( System.in ));
try{
System.out.println( "Enter the first file name: " );
first = in.readLine().trim();
System.out.println ( "Enter the second file name" );
second = in.readLine().trim();
File firstFile = new File ( first );
File secondFile = new File ( second );
if ( firstFile.isDirectory ( ) != true ){
write = new BufferedWriter ( new FileWriter ( secondFile ) );
}//End if
if ( secondFile.isFile ( ) != true ){
read = new BufferedReader ( new FileReader ( firstFile ) );
}//End if
int Q;
while( (Q = read.read()) != -1 ){
write.write ( Q );
}
write.close();
read.close();
}catch ( java.lang.SecurityExceptio
System.out.println( e.getMessage ( ) );
}catch ( java.io.IOException e ){
System.out.println( e.getMessage() );
}//End try
} // main method
} //UniCodeConverter class
Main Topics
Browse All Topics





by: objectsPosted on 2003-02-28 at 16:31:44ID: 8045594
This is not a site for doing your homework for you, in fact I think it is a breach of member agreement.
We can certainly help you with any problems you have implementing the above, but we're not here to write it for you.
Let me know any problems you have and I shall attempt to assist you.