This post demonstrates how to use the new methods – takeWhile and dropWhile – of the Stream interface in Java 9 Jigsaw. We’ll touch briefly on Stream.filter(Predicate p) just to get comfortable before trying out the new methods.
This post shows how to compare two multidimensional arrays of reference types in Java. The codes will examine if they are the same in terms of element values and their
This post demonstrates how to avoid NullPointerException in Java 9 when working with Stream and using the overloaded of metho
This post demonstrates that XML validation against XSDs with
When a XML uses namespaces, they need to be declared and used in the .xsl file so that the javax.xml.transform.Transformer knows how to deal with various elements in the XML. This post demonstrates how to deal with namespaces when performing transformation from or on XMLs.
Two years ago, I used to override the equals() and hashCode() methods via Eclipse’s “Generate hashCode() and equals()…” feature. It proved to be a maintenance nightmare. Every time a new field is added to a class, these methods are updated to include the new instance variable. There is a convenient way to override these methods, toString() included. One that’ll not require subsequent changes when fields are added or remove from a class.
This post demonstrates how to use @Value that has both a configurable default value and a hard-coded final fallback value.
This post briefly demonstrates how to test for a view name in Spring MVC.
With Docker, we can create portable Java CLI applications for various environments by pre-building container images. This could make deployment a lot easier and less messy in particularly in Production environments. This post briefly demonstrates how to create a Docker image with a Java CLI application.
This article demonstrates how come up with the first and last dates of the current quarter.