Tag: Java

Java Stream parallel forEachOrdered

Learn important principles of stream, parallel and forEachOrdered to improve your Java skills! Go deeper into Java Streams concepts by figuring out this Java challenge! Try to solve it before seeing the answer. Remember, you will acquire a new skill...

Java 9 try with resources

Java 9 try catch Error Exception

Use try catch with Exception and Error by using the new try with resources feature from Java 9 by not declaring the Exception into the try block! Take this Java Challenger and be able to use the full power of it! Master recent Java versions by...

Bad Code Naming

Improving Code Naming to Easily Kill Bugs

Method Naming – What is the problem? Method names that don’t describe what they are expected to do are confusing. There are methods that are the “Mr. Know-It-All ” – they do everything you could imagine: they create, update, save...

Why Good Code is Important?

Why Creating Good Code is Important?

Introduction Let’s be honest: there is a lot of really bad code out there. The tsunami of bad code cannot be overcome by the relative handful of gurus who have mastered code craftsmanship. Books become outdated, and the examples in training...

Observer Design Pattern with Java

Do you remember how to use the Swing API with action events? If not, refresh your memory here: When using the Swing API you also use the  Observer pattern maybe even without realizing it. The Observer pattern enables us to decouple the observed...

Proxy Design Pattern with Java

To make code flexible and easy to maintain we must find a way to encapsulate and not repeat the code. What if we need to do a specific treatment every time we get an Exception? Would we repeat this code in the entire application? We could, but...