You may wonder if double checked locking (DCL) works in Java. It does and it doesn’t. I explain why. Continue reading Double Checked Locking in Java
So Java has references. But what about pointers and pass-by-reference? References in Java are different to PHP, C# and other languages. And this can cause some confusion. Continue reading What are References in Java?
In Java it’s important to know what references are and how they are used. So it’s important to know what operations can be performed on references.
Continue reading What Operations can be performed on a Reference in Java?
Java (both the language and the JVM) are not aware of constants. To reduce confusion it’s better to not use the term “constant” in Java code, unless it’s actually a universal constant. Continue reading Java knows no Constants
A language can’t be slow. Or how fast do you think English is?
And modern JVMs are highly optimized. Continue reading Java is not slow
Here’s some advice to all who have just begun learning Java. This also serves as an overview to my blog, where I write about all kinds of misconceptions and common problems with programming in Java. Continue reading Dos and Don’ts
Some Mammals can fly. Dog extends Mammal, but it can’t fly. The term “extends” leads to some misconceptions. Continue reading Misconceptions about the “extends” Keyword
If you want to show some animation, maybe for a simple java game, then you need to render a certain amount of frames per second. For a smooth animation you want 30 to 60 frames per second. But sometimes the needed calculations need a bit longer so the delay until the drawing of the next frame needs to be shorter. For this an animation loop is needed. I have implemented a very simple animation loop for Java 8+ that can be paused and started.
Java doesn’t provide tuples. Here are some ideas what you can do about it. Continue reading Tuples in Java