Hi, graag wil ik uit BufferedWriter newLine() gebruiken.
Maar ik weet nu ff niet hoe ik een compilefout op moet lossen aangaande 'private access'.
De foutmelding is:
bufw.java:22 newLine() has private access in java.io.PrintWriter out.newLine();
**************************************************
Maar ik weet nu ff niet hoe ik een compilefout op moet lossen aangaande 'private access'.
De foutmelding is:
bufw.java:22 newLine() has private access in java.io.PrintWriter out.newLine();
**************************************************
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| import java.io.*;
import java.util.*;
public class bufw
{
public static void main (String[] args)
{
try {
String aFileName = schrijf(args[0]);
}
catch(IOException e) {
e.printStackTrace();
}
}
public static String schrijf(String b) throws IOException
{
PrintWriter out =
new PrintWriter(new BufferedWriter(new FileWriter(b+".html")));
out.write("<html>");
out.newLine(); // regel 22
out.close();
return "piet.html";
}
} |