Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileWriter

Status
Not open for further replies.

daniel87dec

Technical User
Joined
Jan 7, 2004
Messages
9
Location
CA
Can somebody tell me how to solve my problem.

this is pary of my code:

try{
FileWriter fr = new FileWriter("rawdata.txt");
PrintWriter output = new PrintWriter(fr);
String lastNameWithComma = newEmployeeLastNameString+",";
output.print(lastNameWithComma);
output.close();
}catch(IOException e){}
}

I get the following error message: "cannot resolve symbol constructor PrintWriter (FileWriter)"

Thanks in advance
 
Using SDK 1.4, this compiles and runs no problem.

You could always try :

Code:
PrintWriter output = new PrintWriter(new FileOutputStream("rawdata.txt"));
String newEmployeeLastNameString = "ttttt";
String lastNameWithComma = newEmployeeLastNameString+",";
output.print(lastNameWithComma);
output.close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top