What is the Interface Segregation Principle (ISP) in Java?
The Interface Segregation Principle states that a class should not be forced to implement interfaces it doesn't use, meaning interfaces should be divided into smaller, more specific ones.
That's correct. ISP promotes creating specialized interfaces so that implementing classes are not burdened with unnecessary methods.
Can you give an example of a class that violates ISP and how you would refactor it?