When I searched on the internet about extending the Thread class, all the examples I came across had overridden the run()
method. I have also extended the Thread class in my program but I haven't defined the run()
method. It's just another class (I'll refer to it as MyClass), which extends Thread class, with a constructor and a few methods defined by me. However, I'm puzzled because I have created an object of MyClass in the Main class and have called the start()
method using that object in main()
method. And it still works.
My question is whether the run()
method is implicitly defined by the Java compiler, like the default constructor, or is it simply not required to be overridden when extending the Thread class?