Notch がEclipseのこのビデオで話しているこの「実行時のデバッグ」を有効にするにはどうすればよいですか?
テストとして、次のコードの出力を編集して、実行中に「Hello Runtime Debugging」に変更できるようにしたいと考えています。
public class HelloWorld {
public static void main(String[] args) throws InterruptedException {
doIt();
}
private static void doIt() throws InterruptedException {
for (int i = 0; i < 1000; ++i) {
System.out.println("Hello World " + i);
Thread.currentThread().sleep(100);
}
}
}
編集:コードを修正したところ、探していた結果が得られました。以下のSuraj Chandranの回答はそれを説明しています。
private static void doIt() throws InterruptedException {
for (int i = 0; i < 1000; ++i) {
print(i);
Thread.currentThread().sleep(100);
}
}
private static void print(int i) {
System.out.println("Hello Sir " + i);
}