Explain the difference between an abstract class and an interface in Java, and when you would use each.