Spring 3.1 introduced a new and simply way to cache results. In this article we will see how we can use the new Spring caching mechanism and how we can use it within projects. The readers of this article are expected to have some basic knowledge about Spring and the dependency injection (or as it also referred to: inversion of control).

Albert Attard
Author: 4 years ago

In Java 5, a new set of classes related to concurrency was added to the Java API, mostly authored by the famous Doug Lea. These include the ExecutorService (Java Doc) and the Future (Java Doc) classes to name a few, all part of the concurrency framework which was introduced in the same version of Java (Concurrency Utilities Overview). This article describes a problem related with stopping a group or Future in time. It first shows the problem and then proposes a simple solution.

Albert Attard
Author: 4 years ago

Java provides a neat way to carry out long lasting jobs without have to worry about the complexity of threads or lack of responsiveness in an application (by application we mean Swing applications). It is called SwingWorker (Java Doc). It is not the latest thing on Earth (released with Java 1.6) and you may have already read about it. In this article we will see how to use it and why it was created to start with.

Albert Attard
Author: 4 years ago

GSON provides a set annotations to simplify the serialisation and deserialisation processes. In this article we will see how we can use these annotations and how these can simplify the use of GSON to convert between Java objects and JSON objects.

Albert Attard
Author: 4 years ago

This article continues on a previous article, that described simple and basic use of GSON. In this article we will see how to parse complex JSON objects into existing Java objects that do not necessary have the same structure as the JSON object. We will see how the use of the GSON deserialiser (JsonDeserializer Java Doc) in order to control how the JSON object maps to the Java object.

Albert Attard
Author: 4 years ago

Hello World is the first program found in most programming books. Even a book was also written that has Hello World as part of it title (Hello World(s) — From Code to Culture: A 10 Year Celebration of Java Technology). We cannot have a website about Java without starting with the Hello World example.

Following is the classic Hello World program.

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
Albert Attard
Author: 4 years ago