Java Writer cannot call append()

Andrew Haley aph@redhat.com
Thu Feb 9 13:35:00 GMT 2006


Rui Wang writes:
 > Hi, 
 > 
 > I did a test on GCJ4.2.0 on file output on Fedro code 3. 
 > 
 > The following lines of java code are the code I am testing: 
 > 
 > Writer output = new BufferedWriter(new FileWriter("out.d"));
 > 
 > output.append("random output");
 > output.newLine();
 > 
 > 
 > 
 > if I use gcj to compile the code, the following error will be found:
 > 
 > Client.java:51: error: Can't find method âappend(Ljava/lang/String;)â in type âjava.io.Writerâ.
 >                     output.append("random output");
 >                              ^
 > Client.java:52: error: Can't find method ânewLine()â in type âjava.io.Writerâ.
 >                     output.newLine();
 > 
 > 
 > Any ideas why? 

See http://java.sun.com/j2se/1.4.2/docs/api/.

Writer.append(CharSequence) is part of the 1.5 spec.

Andrew.



More information about the Java mailing list