Core Java

Handling Currency

Currency can be tricky in programming languages that use floating point numbers as they are not able to accurately represent some numbers (e.g. 0.1). For Java, there is a dedicated datatype to handle currency and operations with currency.

Handling Currency
ActionListener via Lambda

ActionListener used to be created via inner anonymous classes. With Java8, you can use the more elegant lambda expressions instead.

ActionListener via Lambda
Parallelization

In this article, I try to analyze runtime efficiency of several parallelization approaches. As an example, I construct a text processing problem.

Java Parallelization
Reading Files

Reading text files line-by-line is a common task. Due to backwards compatability, there are several ways to do it.

Reading Files
Simplify Switch Statements

Switch statements are an elegant alternative to if/else blocks. However, they can become complex when they are applied to strings with many possible values. In this article, I show another way of modeling an event-based system.

Simply Switch Statements