SyntaxFix
Write A Post
Hire A Developer
Questions
If you are on Java 10, you can use var for that:
var
var ordinal = new Object() { int value; }; list.forEach(s -> { s.setOrdinal(ordinal.value); ordinal.value++; });