Witam niestety poprzedni wątek został usunięty przez niemiłą wypowiedź osoby, która usiłowała mi pomoc. Niestety wciąż mam problem na Java 8
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
public class inl {
public static void main(String[] args) throws IOException {
String data = Files.lines(Paths.get("teksty.txt"))
.collect(Collectors.joining());
List<String> matched = Files.lines(Paths.get("hasla.txt"))
.filter(data::contains)
.collect(Collectors.toList());
for (String match : matched) {
System.out.println(match);
}
}
}
.filter(data::contains) mam podkreślony i taki błąd mi wyskakuje:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method filter(Predicate<? super String>) in the type Stream<String> is not applicable for the arguments (String)
Syntax error on tokens, delete these tokens
at inl.main(inl.java:12)
jakieś rozwiązania takiego problemu może ktoś zaoferować?