A simple Thread scenario in Java where the Runnable interface need not be implemented by the Thread implementing class
<p>Let's look at the following code, it's working exactly.</p>

<pre><code>final class DemoThread
{
    public void temp()
    {
        new Thread(new Runnable()
        {
            public void run()
            {
                System.out.println( "Isn't it great ?" ) ;
            }
        } ) .start() ;
    }
}

final public class Main
{
    public static void main(String[] args)
    { 
        new DemoThread().temp();
    }
}
</code></pre>

<p>It works fine and displays the message <em>Isn't it great ?</em> on the console. The only question here is that why the Runnable interface need not be implemented by the class <strong>DemoThread</strong>?</p>
