Tag: java

Total 189 Posts

Using Global Variables/Constants in Java

Introduction

Java's object-oriented code structure can make referencing variables in multiple places more difficult. It can also be difficult at times to decide which class a given variable should be a part of, especially if it's a widely used value like a database connector or mathematical constant.

In many languages,

Continue Reading

Build a Spring Boot REST API with Java - Full Guide

Introduction

REST stands for REpresentational State Transfer, a standardized approach to building web services.

A REST API is an intermediary Application Programming Interface that enables two applications to communicate with each other over HTTP, much like how servers communicate to browsers.

RESTful is the most common approach for building web

Continue Reading

Selection Sort in Java

Introduction

Sorting data is a frequent problem in computer science. Given a collection of elements, the goal is to rearrange them in some order. Common examples are sorting an array alphabetically or from smallest to largest.

Sorted data is a lot easier to manipulate. Finding the largest or smallest element

Continue Reading

How to Split a String in Java

Introduction

Oftentimes, we are faced with a situation where we need to split a string at some specific character or substring, to derive some useful information from it.

For example, we might want to split a phone number on the country code or data imported from a CSV file.

In

Continue Reading