Home » Java » Core Java (page 20)

Core Java

Behavioural Design Patterns: Mediator

Previously we had a look at the iterator pattern. The mediator pattern is way different on what it tries to achieve. It is one of the behavioural patterns and its purpose is to alter the way objects communicate with each other. Instead of the objects communicating with each other directly the mediator will handle the objects interaction. For example imagine ...

Read More »

Java optional parameters

When you design a method in a Java class, some parameters may be optional for its execution. No matter it is inside a DTO, a fat model domain object, or a simple stateless service class, optional method parameters are common. From this article you will learn how to handle optional parameters in Java. We’ll focus on regular method, class constructors ...

Read More »

In any incomprehensible situation go scripting


Scripting is one of the most popular ways to make your application adjustable for client needs right at runtime. As always, this approach brings not only good, e.g. there is a well-known trade-off between flexibility and manageability. This article is not one of those which theoretically discuss pros and cons, it practically shows different ways of how to adopt scripting ...

Read More »

JDK 12’s Files.mismatch Method

JDK 12 introduces a new method to the Files class. The method, Files.mismatch(Path,Path), has been introduced to JDK 12 via JDK-8202302 and is available in JDK 12 Early Access Build 20 (same early access build that supports the new {@systemProperty} Javadoc tag). JDK-8202302 [“(fs) New Files.mismatch method for comparing files”] adds the Files.mismatch(Path,Path) method “to compare the contents of two ...

Read More »

[MEGA DEAL] Complete Java Programming Bootcamp (94% off)

10 Courses (83.5 Hours) to Become a Java Master: Design UIs with JavaFX, Utilize Design Patterns, Master Multithreading & More Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer. We are offering the Complete Java Programming Bootcamp for only $39 instead of the original price of $740.00 , yeap that is a massive 94% off. ...

Read More »

JDK 12 Javadoc Tag for System Properties

JDK 12 Early Access Build 20 (2018/11/15) is available and can be used to try out the new Javadoc tag {@systemProperty}. The new {@systemProperty} Javadoc tag is discussed in the core-libs-dev mailing list message “FYI: new javadoc tag to document system properties” and was introduced in response to JDK-5076751 [“System properties documentation needed in javadocs”]. The {@systemPropery} Javadoc tag displays ...

Read More »

Functional Java by Example | Part 5 – Move I/O to the Outside

This is part 5 of the series called “Functional Java by Example”. In previous part we stopped mutating our documents and returned copies of the data. Now, we need to move some I/O away. If you came for the first time, it’s best to start reading from the beginning. It helps to understand where we started and how we moved ...

Read More »