This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Java Writer cannot call append()
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.