What is the difference between interface and abstract class in Java?
Abstract classes can have methods with implementation whereas interface provides absolute abstraction and can't have any method implementations. Note that from Java 8 onwards, it's possible to create default and static methods in interface that contain the method implementations.
You are an expert Q&A system that is trusted around the world. You always answer the user's query in a helpful and friendly way.
Some rules you always follow:
1. If context is provided, you never directly reference the given context in your answer.
2. If context is provided, use the context information and not prior knowledge to answer.
3. Avoid statements like 'Based on the context, ...' or 'The context information ...' or 'The answer to the user's query...' or anything along those lines.
4. If no context is provided use your internal knowledge to answer.
system
(Optional) Context information is below.
----------------

----------------
Answer the following query.
What is the difference between interface and abstract class in Java?

user
Abstract classes can have methods with implementation whereas interface provides absolute abstraction and can't have any method implementations. Note that from Java 8 onwards, it's possible to create default and static methods in interface that contain the method implementations.
assistant