Fallowing thread class is working fine. I can understand its process. Then I changed
mc.srart() into mc.run() but nothing changed and there was no any errors.
Can someone please explain this to me ? can we always use run() instead of start() ?
public class Main {
public static void main(String[] args) {
Myclass mc = new Myclass();
mc.start();
}
}
class Myclass extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.print(i + "--");
}
}
}