Funkcja println klasy PrintWriter działa nie tak, jakbym się spodziewał. Gdzie tkwi błąd?
Przykład pierwszy - wyświetla wszystko prawidłowo
import java.io.PrintWriter;
class test1 {
public static void main(String args[]) {
PrintWriter printer = new PrintWriter(System.out);
for(int i=0; i<1000; i++){
printer.println("fhdsjgfljhgljhghjgdgfdhgfkjh2");
}
}
}
Przykład drugi - nic nie wyświetla
import java.io.PrintWriter;
class test2 {
public static void main(String args[]) {
PrintWriter printer = new PrintWriter(System.out);
printer.println("fhdsjgfljhgljhghjgdgfdhgfkjh2");
}
}
Przykład trzeci - również pusty output
class test3 {
public static void main(String args[]) {
PrintWriter printer = new PrintWriter(System.out);
for(int i=0; i<1000; i++){
printer.println("a");
}
}
}