I have the following code ("codes" is an array variable):
Arrays.asList(codes)
.stream()
.filter(code -> code.hasCountries())
.sorted()
.toArray()
);
The compiler gives me the following error:
Syntax error on token ")", ElidedSemicolonAndRightBrace expected
What's wrong here?
This error simply means that you have too many closing parenthesis. The code should be:
Arrays.asList(codes)
.stream()
.filter(code -> code.hasCountries())
.sorted()
.toArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With