I am debugging a Java application in NetBeans IDE 8.0.2.
When a method is called Thread.start(), I cannot reach the method of run()this thread (although I set breakpoints in this method). However, sometimes he strikes the method, but sometimes not.
How can I use the method run()during debugging?
public class JavaApplication7 {
public static void main(String[] args) {
Mailthread1 mt1 = new Mailthread1();
Thread pt = new Thread(mt1);
pt.setName("Mailthread");
pt.start();
}
}
And Thread class:
class Mailthread1 implements Runnable {
public void run() {
System.out.println("Cant hit this line");
}
}
source
share