Nantes Université

Skip to content

risk-game-e : Return Type Should Be an Interface Instead of a Specific Implementation

urrently, the return type of the method is using a specific implementation of a collection (e.g., ArrayList). It is a best practice to return a collection interface (e.g., List) rather than a specific implementation class. This helps improve flexibility, maintainability, and testability of the code.