It is surprising how many useful classes can be found in java.util that are not commonly known to general public. Every now and then I stumble upon a class that has the functionality I have been implementing over and over my myself and today I will tell you about one of them: have you ever [...]
String and memory leaks
This post is inspired by an entry on nflath.com about the dangers of String.substring() method.
Probably most of the Java users is aware that String object is more complex than just an array of char. To make the usage of strings in Java more robust additional measures were taken – for instance the String pool was [...]
How to write a Singleton? (2/5)
In one of the recent posts I was trying to convince everyone not to create singletons. For those who still are not convinced I show today how to write it in a simplest and safest way possible. The following code base on one assumption: you do not need lazy initialization.
The idea behind lazy [...]