Difference between interface-abstract (not duplicate) <p>I want to know the difference between the two codes. I have a interface: lets say : </p> <pre><code>public interface iaminterface { void m1(); void m2(); void m3(); } </code></pre> <p>First Code : </p> <pre><code>public abstract class iamabstract implements iaminterface { public void m1(){} public abstract void m2(); // abstract method .So i need to override this in the subclasses. } public class car extends iamabstract { public void m2(){} public void m3(){} } public class train extends iamabstract { public void m2() {} public void m3() {} } </code></pre> <p>This code will compile successfully. But this code is same as writing :</p> <p>Second Code: </p> <pre><code> public abstract class iamabstract implements iaminterface { public void m1(){} } public class car extends iamabstract { public void m2(){} public void m3(){} } public class train extends iamabstract { public void m2() {} public void m3() {} } </code></pre> <p>I don't understand the difference in the two codes. Both codes will function in a similar way. One has a abstract method and another does not have a abstract method, so we need to implement the unimplemented methods of the interface. So , what's the use of writing the method m2() as abstract in the first code. ?</p>