Java challenges

A collection of programming challenges solved using Java


With this part of the Challenges project, I provide solutions to common programming challenges in Java.

Below, I first give an overview of the challenges that I have solved so far. I then provide some background information on Java and the tools I used, namely, IntelliJ IDEA and Maven.

1. Overview

Currently, Java solutions are available for the following challenges, categorized according to the tools I used.

1.1 IntelliJ IDEA projects

I solved the following challenges using IntelliJ IDEA. For some challenges, I did not use a build tool (general). For others, I made use of Maven.

1.1.1 General


1.1.2 Maven


2. Background

In this section, I provide some background information on Java and the tools I used to solve the above-mentioned programming challenges, namely, IntelliJ IDEA and Maven.

2.1 Java

Java is an object-oriented programming language with a syntax similar to C and C++. As is the case for C and C++ code, Java code has to be compiled before it can be executed. C and C++ are, however, compiled into platform-specific machine code. Instead, Java compiles to platform-independent class files containing so-called bytecode. This bytecode can be executed on a platform of choice by a platform-specific Java virtual machine (JVM).

Most of the above-mentioned projects are configured to use the latest long-term support (LTS) version of Java (Java 20 at the time of writing). These projects require the installation of the Java Development Kit (JDK) 20 or later (see, e.g.,

2.2 IntelliJ IDEA

IntelliJ IDEA is an integrated development environment (IDE) developed by JetBrains. This IDE supports Java and several other JVM languages and can be extended with plugins to retrieve support for other programming languages. IntelliJ IDEA has detailed online documentation, and its community edition can be downloaded and used for free.

IntelliJ IDEA makes it easy to configure code styles, automatic copyright notices, code inspection profiles, run configurations and more. The basic IntelliJ IDEA configuration used in the above-mentioned projects is described in the IntelliJ IDEA section of Setting up a basic Java project using IntelliJ IDEA.

2.3 Maven

Maven is a build tool that can be used to manage and build projects written in Java and other programming languages. The project object model, a file named pom.xml, is central to using Maven. In this file, the project properties can be set, build plugins can be configured, project dependencies can be defined, etc.

The basic Maven configuration used in the above-mentioned projects is discussed in the Maven section of Setting up a basic Maven project using IntelliJ IDEA. A step-by-step guide for setting up a Maven project using IntelliJ IDEA can be found in the Maven section of IntelliJ IDEA's online documentation.


Copyright © 2021–2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the GNU General Public License v3.0 or later.