Home » Tag Archives: Java 8 (page 8)

Tag Archives: Java 8

Listing a ZIP file contents with Stream API in Java 8

java-logo

In Java 8 java.util.zip.ZipFile was equipped with a stream method that allows navigating over a ZIP file entries very easily. In this blog post I will show a bunch of examples showing how quickly we can navigate over ZIP file entries. Note: For the purpose of this blog post I downloaded one of my GitHub repositories as a ZIP file ...

Read More »

Java 8 Optional: How to Use it

java-logo

Java 8 comes with a new Optional type, similar to what is available in other languages. This post will go over how this new type is meant to be used, namely what is it’s main use case. What is the Optional type? Optional is a new container type that wraps a single value, if the value is available. So it’s ...

Read More »

Spring 4: @DateTimeFormat with Java 8 Date-Time API

java-logo

@DateTimeFormat annotation that was introduced in Spring 3.0 as a part of Formatter SPI can be used to to parse and print localized field values in web applications. In Spring 4.0, @DateTimeFormat annotation can be used with Java 8 Date-Time API (java.time) out-of-the-box, without extra effort. In Spring, field formatting can be configured by field type or annotation. To bind ...

Read More »

Java 8 StampedLocks vs. ReadWriteLocks and Synchronized

java-logo

Synchronized sections are kind of like visiting your parents-in-law. You want to be there as little as possible. When it comes to locking the rules are the same – you want to spend the shortest amount of time acquiring the lock and within the critical section, to prevent bottlenecks from forming. The core language idiom for locking has always been ...

Read More »

Parsing a file with Stream API in Java 8

java-logo

Streams are everywhere in Java 8. Just look around and for sure you will find them. It also applies to java.io.BufferedReader. Parsing a file in Java 8 with Stream API is extremely easy. I have a CSV file that I want to be read. An example below:             username;visited jdoe;10 kolorobot;4 A contract for my ...

Read More »

Java 8 Friday: Better Exceptions

java-logo

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and other great stuff. You’ll find ...

Read More »

Java 8 default methods can break your (users’) code

java-logo

At first glance, default methods brought a great new feature to the Java Virtual Machine’s instruction set. Finally, library developers are able to evolve established APIs without introducing incompatibilities to their user’s code. Using default methods, any user class that implements a library interface automatically adopts the default code when a new method is introduced to this interface. And once ...

Read More »

Java 8 Friday: Language Design is Subtle

java-logo

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and other great stuff. You’ll find ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close