#Cannot infer type arguments for ArrayList<>
1 messages · Page 1 of 1 (latest)
In the line PlayerType players = new ArrayList<>() there are a couple of errors... and you're seeing only the first
- The
<>(diamond operator) can't infer the generic parameters from the target-typePlayerTypebecause no generic parameters are supplied (assumingPlayerTypeis even a generic class) ArrayListcan't be assigned to a reference field of typePlayerTypebecauseArrayListis not a subclass ofPlayerType(or implementing that interface ifPlayerTypeis an interface).
Is players supposed to be a List of PlayerType (rather than a single PlayerType?
@neon jolt ↑