Java 8 Write to File Examples: Three ways

In this article, we introduce you Java 8 Write to File Examples using Java 8 APIs along with Files.newBufferedWriter, Files.write and Files.newOutputStream. Let’s deeper via examples below: Write to file using BufferedWriter You can use the newBufferedWriter(Path, Charset, OpenOption…) method to write to a file using a BufferedWriter. The following code snippet shows how to … Read more

Java 8 Stream Distinct Examples

Today, I walk you through Java 8 Stream Distinct Examples using stream API. You can filter or collect all distinct elements from a collection by using distinct() of Stream API. In case, we have to process a collection of complex objects we need to write a custom function for the specific filtering purpose. 1. Java … Read more

Please share it if you found this useful
Hide Buttons