Rich Internet Applications are those web applications which provide similar features and experience as that of desktop applications. They offer a better visual experience when compared to the normal web applications to the users. These applications are delivered as browser plug-ins or as a virtual machine and are...
Friday, December 30, 2022
Wednesday, December 28, 2022
How to build applications with the WebSocket API for Java EE and Jakarta EE
WebSocket is a two-way communication protocol that lets clients send and receive messages over a single connection to a server endpoint.Download a PDF of this articleWebSocket is a two-way communication protocol that lets clients send and receive messages over a single connection to a server endpoint. The Jakarta...
Monday, December 26, 2022
Curly Braces #7: Complex math, BigDecimal, and infinity
Fortran has built-in functions for complex math. How do you handle that in Java?My love for math has varied through the years and encompassed everything up to advanced math learned for a college physics class. I excelled—as long as I was applying the concepts to solve problems. As...
Wednesday, December 21, 2022
Quiz yourself: Lambda expressions and local variables in Java
A philosophical question: What is the value of a variable that doesn’t exist?Given the following Capture classimport java.util.function.Supplier;public class Capture { public static void main(String[] args) { System.out.println(supp1().get() + supp2().get()); } static Supplier<String> supp1() { var val = "Supp...
Monday, December 19, 2022
Capitalize English Titles With Java, Quarkus & GraalVM
Over the years, I’ve been writing a lot in English, which isn’t my mother tongue, and for writing titles (headlines, article titles, etc.) I always have to think which words to capitalize. Thus, I’ve created a small tool, of course written in Java, that I use as command...
Friday, December 16, 2022
Quiz yourself: Sealed and non-sealed classes and interfaces
Sealed types limit the set of types that can be assigned to a base type.Given the following codesealed interface Super permits Sub1, Sub2, Sub3 {}non-sealed class Sub1 implements Super {}record Sub2(Super s) implements Super {}enum Sub3 implements Super { SUB_A{}, SUB_B{} }Which statement is true? Choose one.A. The...
Wednesday, December 14, 2022
Nothing is better than the Optional type. Really. Nothing is better.
The blogosphere is full of claims that the Optional class solves the problem of null pointer exceptions. This is not true.JDK 8 introduced the Optional class, a container that is either empty or contains a non-null value.Optional has numerous problems without countervailing benefits. It does not make your...