Error
The method forEach(Consumer<? super Integer>) in the type Iterable<Integer> is not applicable for the arguments (Predicate<String>)
while using forEach and Lambda Expressions in Java 8.
Error Type
Compile Time
Sample Code
public class BuggyBread1 extends SuperBuggyBread{
public static void main (String args[]) {
}
}
Cause
SuperBuggyBread is not a class. It might be an Interface or an Enum.
Resolution
Enum types are final by design so they cannot be extended.
Interfaces can be implemented using implements instead of extends.
Make sure that SuperBuggyBread is either a class or implement it if its an interface.'
The method forEach(Consumer<? super Integer>) in the type Iterable<Integer> is not applicable for the arguments (Predicate<String>)
while using forEach and Lambda Expressions in Java 8.
Error Type
Compile Time
Sample Code
public class BuggyBread1 extends SuperBuggyBread{
public static void main (String args[]) {
}
}
Cause
SuperBuggyBread is not a class. It might be an Interface or an Enum.
Resolution
Enum types are final by design so they cannot be extended.
Interfaces can be implemented using implements instead of extends.
Make sure that SuperBuggyBread is either a class or implement it if its an interface.'