The XOR Operator in Java
1. Overview In this short tutorial, we're going to learn about the Java XOR operator. We'll go through a bit of theory about XOR operations, and then we'll see how to implement them in Java. 2. The XOR...
View ArticleStable Sorting Algorithms
1. Overview In this tutorial, we'll learn what stable sorting algorithms are and how they work. Further, we'll explore when the stability of sorting matters. 2. Stability in Sorting Algorithms The...
View ArticleJava Weekly, Issue 296
Here we go… 1. Spring and Java >> Why Clojure? [blog.cleancoder.com] With minimal syntax and grammar, Clojure is essentially a Lisp variant for the Java ecosystem. And a personal favorite....
View ArticleBuilding Java Applications with Bazel
1. Overview Bazel is an open-source tool for building and testing source code, similar to Maven and Gradle. It supports projects in multiple languages and builds outputs for multiple platforms. In this...
View ArticleConcatenating Text Files into a Single File in Linux
1. Overview Linux provides us commands to perform various operations on files. One such activity is the concatenation – or merging – of files. In this quick tutorial, we'll see how to concatenate files...
View ArticleParsing an XML File Using StAX
1. Introduction In this tutorial, we'll illustrate how to parse an XML file using StAX. We'll implement a simple XML parser and see how it works with an example. 2. Parsing with StAX StAX is one of the...
View ArticleGetting the Absolute Directory of a File in Linux
1. Introduction In this tutorial, we will see how to get the absolute directory of a given file using two common Linux file system tools. 2. Prerequisites Unfortunately, there currently isn't a single...
View ArticleCounting Sort in Java
1. Overview General-purpose sorting algorithms like Merge Sort make no assumption about the input, so they can't beat the O(n log n) in the worst case. Counting Sort, on the contrary, has an assumption...
View ArticleJava ‘public’ Access Modifier
1. Overview In this article, we'll cover the public modifier in-depth, and we'll discuss when and how to use it with classes and members. Additionally, we'll illustrate the drawbacks of using public...
View ArticleJava ‘private’ Access Modifier
1. Overview In the Java programming language, fields, constructors, methods, and classes can be marked with access modifiers. In this tutorial, we'll talk about the private access modifier in Java. 2....
View ArticleImplementing a Simple Blockchain in Java
1. Overview In this tutorial, we'll learn the basic concepts of blockchain technology. We'll also implement a basic application in Java that focuses on the concepts. Further, we'll discuss some...
View ArticleA Guide to Spring Boot Configuration Metadata
1. Overview When writing a Spring Boot application, it's helpful to map configuration properties onto Java beans. What's the best way to document these properties, though? In this tutorial, we’ll...
View ArticleJava Weekly, Issue 297
Here we go… 1. Spring and Java >> Candidate JEPs: Records and Sealed Types [marxsoftware.com] Two related Java preview feature proposals that, when taken together, may be combined to form...
View ArticleCommand-Line Arguments in Java
1. Introduction It's quite common to run applications from the command-line using arguments. Especially on the server-side. Usually, we don't want the application to do the same thing on every run: we...
View ArticleConvert Character Array to String in Java
1. Overview In this quick tutorial, we'll cover various ways to convert a character array to a String in Java. 2. String Constructor The String class has a constructor that accepts a char array as an...
View ArticleAdd a Header to a Jersey SSE Client Request
1. Overview In this tutorial, we'll see an easy way to send headers in Server-Sent Event (SSE) client requests using the Jersey Client API. We'll also cover the proper way to send basic key/value...
View ArticleHow to Avoid the Java FileNotFoundException When Loading Resources
1. Overview In this tutorial, we'll explore an issue that can come up when reading resource files in a Java application: At runtime, the resource folder is seldom in the same location on disk as it is...
View ArticlePrimitive Collections in Eclipse Collections
1. Introduction In this tutorial, we'll talk about primitive collections in Java and how Eclipse Collections can help. 2. Motivation Suppose we want to create a simple list of integers:...
View ArticleIntro to DataStax Java Driver for Apache Cassandra
1. Overview The DataStax Distribution of Apache Cassandra is a production-ready distributed database, compatible with open-source Cassandra. It adds a few features that aren't available in the...
View ArticleRemoving an Element From an ArrayList
1. Overview In this tutorial, we're going to see how to remove elements from an ArrayList in Java using different techniques. Given a list of sports, let's see how we can get rid of some elements of...
View Article