I have this code, but it gives me an error:
Type mismatch: cannot convert from int to Character
Stream.iterate('a', i -> i + 1).limit(26).forEach(System.out::println);
Although it is fine to write int i = 'a';
I know I can write it like this, but that seems like too much code for a simple task.
Stream.iterate('a', i -> (char)(i + 1)).limit(26).forEach(System.out::println);
Why is the Java type inference failing?