How method preference work in java? <p>I just want to understand how below code snippet work ?</p> <pre><code>class AnnaThread extends Thread { public static void main(String args[]){ Thread t = new AnnaThread(); t.start(); } public void run(){ System.out.println("Anna is here"); } public void start(){ System.out.println("Rocky is here"); } } </code></pre> <p>Output - Rocky is here</p>