This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Because Runnable only defines one method: run. So the call: Thread thread = new Thread(runnable); thread.run(); Calls the default run() method in the Thread base class, which in turn calls the start() method of the Runnable instance runnable. HTH :roll: :roll:
Joined: Mar 08, 2001
I just thought it over: - "extends Thread" => bgr.start() is of type "Background" as bgr is background instance. According to Polymorphism: Whith overridden method the type of the object determines the invoked method: => bgr is of type "Background" hence "Background" start() method is invoked and not the "super.start" of Thread class! - "implements Runnable" => new Thread(bgr).start() => Instance of Runnable => according to polymorphism => start() method of Runnable is invoked and Thread is startet.