The differences between the two can be categorized as development and design differences. Let us see each category one by one:

Development related differences

1) A class can extend multiple other classes but can implement only one interface at a time.

2) All the methods of an interface are public, abstract implicitly whereas an abstract class may have private non-abstract and non-private abstract methods. The methods in abstract class have to be classified as public, private, abstract, static explicitly. This is illustrated in the snippets below:

Interface

package com.example;

public interface Test{

       private abstract void abc();   //throws compiler error
       void def() {} //throws compiler error

       abstract void ghi(); //valid method as it is public  implicitly
       int jkl(); //valid method as it is public abstract by default

}

Abstract class

package com.example;

public abstract class TestClass{

        private abstract void abc();   //throws compiler error as abstract methods/classes can't be private

        void def() {} //valid default method
        private void ghi() {}  //valid normal method
        public abstract void jkl(); //valid abstract method
}

3) An interface can only be public abstract and is so implicitly. On the other hand, an abstract class should be abstract explicitly and is non-private implicitly. If an abstract class is made private explicitly, a compiler error is thrown. This is because of the fact that an abstract entity is meant to be overridden with a concrete implementation and making it private will stop it from being visible and hence from being overridden.

4) The variables declared in an interface are public static final by default (even without you declaring them public static) where as an abstract class may have any kind of variables. If you try declaring a non-public non-static variable in an interface then a compiler error will be thrown.
Since we use public static final to declare constants and interface make variables that way by default, there is a debate on whether to use an interface to define constants or not. The advantage of using classes for defining constants is that you have a chance to initialize through constructors.

5) You use the implements keyword to implement an interface where as abstract classes are meant to be inherited.

6) An interface can extend (not implement) other interfaces whereas an abstract class may implement any number of interfaces and extend one class.

7) A Java interface can never have a constructor but abstract classes do have constructors which are invoke implicitly when creating an instance of sub class of the abstract class.

Design related differences and guidelines

1) You may use an interface for just marking a behavior like marking a class as serializable by using Serializable interface. The use of marker interface is debatable but abstract classes should always be created for code reuse.

2) Extending an abstract class brings inheritance in picture and the sub class gets tied to the sub class and hence abstract classes should be used when a strong relationship between two classes makes sense.

3) Since an abstract class can implement an interface, both can be used in a single context. A good mix and match of interfaces, abstract classes and concrete classes can be seen in the Java collection hierarchy.

4) A rule of thumb for deciding between what to choose from interface and abstract class is:

  • Use abstract class only when you have code reuse coming in picture. Sometime code reuse may not be clear during initial design phase. If you see high chances of code reuse in future then go for abstract classes. For e.g. You may go for Structure abstract class for a super type of Square, Circle or Rectangle classes even if you don’t any code reuse at this time but may add concrete methods like getOwner, getConsumer to Structure abstract class.
  • Use interface when the interface is just a contract and has no parent-child relationship with its sub types. Since interface can’t have concrete methods, there should be no code-reuse requirement when using an interface.
Differences between Abstract class and interface admin Core Java
The differences between the two can be categorized as development and design differences. Let us see each category one by one: Development related differences 1) A class can extend multiple other classes but can implement only one interface at a time. 2) All the methods of an interface are public, abstract implicitly...
<p>The differences between the two can be categorized as development and design differences. Let us see each category one by one:</p> <h2>Development related differences</h2> <p> 1) A class can extend multiple other classes but can implement only one interface at a time. 2) All the methods of an interface are public, abstract implicitly whereas an abstract class may have <strong>private non-abstract</strong> and <strong>non-private abstract</strong> methods. The methods in abstract class have to be classified as public, private, abstract, static explicitly. This is illustrated in the snippets below: </p> <strong>Interface</strong> 1 <strong>Abstract class</strong> 1 <p> 3) An interface can only be public abstract and is so implicitly. On the other hand, an abstract class should be abstract explicitly and is non-private implicitly. If an abstract class is made private explicitly, a compiler error is thrown. This is because of the fact that an abstract entity is meant to be overridden with a concrete implementation and making it private will stop it from being visible and hence from being overridden. 4) The variables declared in an interface are <strong>public static final</strong> by default (even without you declaring them public static) where as an abstract class may have any kind of variables. If you try declaring a non-public non-static variable in an interface then a compiler error will be thrown. Since we use public static final to declare constants and interface make variables that way by default, there is a debate on whether to use an interface to define constants or not. The advantage of using classes for defining constants is that you have a chance to initialize through constructors. 5) You use the implements keyword to implement an interface where as abstract classes are meant to be inherited. 6) An interface can extend (not implement) other interfaces whereas an abstract class may implement any number of interfaces and extend one class. 7) A Java interface can never have a constructor but abstract classes do have constructors which are invoke implicitly when creating an instance of sub class of the abstract class. </p> <h2>Design related differences and guidelines</h2> <p> 1) You may use an interface for just marking a behavior like marking a class as serializable by using <a href="http://www.javaexperience.com/object-serialization-in-java/">Serializable interface</a>. The use of marker interface is debatable but abstract classes should always be created for code reuse. 2) Extending an abstract class brings inheritance in picture and the sub class gets tied to the sub class and hence abstract classes should be used when a strong relationship between two classes makes sense. 3) Since an abstract class can implement an interface, both can be used in a single context. A good mix and match of interfaces, abstract classes and concrete classes can be seen in the Java collection hierarchy. 4) A rule of thumb for deciding between what to choose from interface and abstract class is: <ul> <li> Use abstract class only when you have code reuse coming in picture. Sometime code reuse may not be clear during initial design phase. If you see high chances of code reuse in future then go for abstract classes. For e.g. You may go for Structure abstract class for a super type of Square, Circle or Rectangle classes even if you don't any code reuse at this time but may add concrete methods like getOwner, getConsumer to Structure abstract class. </li> <li> Use interface when the interface is just a contract and has no parent-child relationship with its sub types. Since interface can't have concrete methods, there should be no code-reuse requirement when using an interface. </li> </ul> </p>