Answer the question
In order to leave comments, you need to log in
Console in java?
A small question about JRE and standard output to the console.
For example, I compile and package this simple and completely pointless code into a runnable jar:
package Experimental;
import java.io.*;
public class Main {
public static void main(String[] args) {
for(char i=0; i<512; ++i) {
System.out.write(i);
System.out.write('\n');
}
}
}
package Experimental;
import java.io.*;
public class Main {
public static void main(String[] args) {
try (FileOutputStream out=new FileOutputStream("out.txt");) {
for(char i=0; i<512; ++i) {
out.write(i);
out.write('\n');
}
}
catch(IOException e) {
System.out.print("Error!");
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question