If you use System.out.println () etc. to output the log to the console, it may be difficult to find the log because it is buried when you want to check the console log.
Sample
public class Sample {
public static void main(String[] args) {
for (int i=0; i<10; i++) {
if (i == 5) {
System.out.println(i+"This is the second loop.");
}
if (i%3==0) {
System.out.println("Hoge Hoge");
} else if (i%3==1) {
System.out.println("Huga Huga");
} else {
System.out.println("Moku Moku");
}
}
}
}
In such a case, you can use ** System.err.println ** to display the item you want to check in red. In Eclipse, the standard error output seems to be output in red. (By the way, the standard input is green)
if (i == 5) {
System.err.println(i + " times");
}
Recommended Posts