Category: Java

The Java programming language and standard library features.

JAXB on Java 9, 10, 11 and beyond

If you have programs that use JAXB (Java Architecture for XML Binding) and you’ve tried to compile and run them on Java versions newer than Java 8, you’ll have noticed that you get errors. There are changes in Java SE 9, 10 and 11 that you need to know about...

My first Pluralsight course is live

It’s been a while I’ve written a blog post. One major reason for this is that I’ve been very busy in my free time in the last four months of 2016. I was working on my first course for Pluralsight: Java EE: Getting Started with JavaServer Faces. Pluralsight is a...

Don’t use the double-brace initialization trick

Introduction Java unfortunately does not have a convenient syntax for initializing collections. There’s a trick that developers sometimes use, the double-brace initialization trick, to make initializing for example a Map more convenient. This trick has obvious and less obvious disadvantages and you should not use it. In this post I...

Scala access modifiers and qualifiers in detail

Just like Java and other object-oriented programming languages, Scala has access modifiers to restrict access to members of classes, traits, objects and packages. Scala’s access modifiers are slightly different than Java’s; in this post I explain the difference. Besides modifiers, Scala also has qualifiers which allow more fine-grained access control....

7 Scala features that surprise Java developers

When you know Java, it isn’t that hard to start programming in Scala. Everything you know about object-oriented programming in Java also applies to Scala. Ofcourse Scala is not just Java with a less verbose syntax; it also has a number of features that Java lacks, such as functional programming...

Scala as a better Java

This one is for the Java developers who are curious about Scala. Maybe you have briefly looked at Scala and you were deterred by what at first sight looked like ugly syntax with strange, incomprehensible operators, or you think you have to become a functional programming wizard to understand it....

Project Valhalla – Generic Specialization

Last week I wrote about value types, which are one of the new language features that are being investigated for a future version of Java. This time I’ll explain another possible new language feature being investigated in Project Valhalla: generic specialization. In Java, you can only use reference types as...

Project Valhalla – Value Types

In July last year, Brian Goetz announced Project Valhalla, an experimental project to explore major new language features for a future version of Java. Features to be investigated are: Value types Generic specialization Enhanced volatiles Possibly other related topics, such as reified generics The features in Project Valhalla are not...