Tag: java

Total 148 Posts

Guide to Using Optional in Java 8

Introduction

When writing any kind of code in Java, developers tend to work with objects more often than with primitive values (int, boolean, etc). This is because objects are at the very essence of object-oriented programming: they allow a programmer to write abstract code in a clean and structured manner.

Continue Reading

The Builder Design Pattern in Java

Introduction

In this article, we'll be breaking down the Builder Design Pattern and showing it's application in Java.

Design Patterns are simply sets of standardized practices commonly used in the software development industry. They represent solutions, provided by the community, to common problems faced in every-day tasks regarding software development.

Continue Reading

Java: Check if a File or Directory Exists

Introduction

Checking if a file or directory exists is a simple and important operation in many tasks. Before accessing a file, we should check if it exists to avoid a NullPointerException. The same goes for directories.

While some functions may create a new file/directory if the requested one doesn't

Continue Reading

Method Overriding in Java

Introduction

Object-Oriented Programming (OOP) encourages us to model real-world objects in code. And the thing with objects is that some share outward appearances. Also, a group of them may display similar behavior.

Java is an excellent language to cater to OOP. It allows objects to inherit the common characteristics of

Continue Reading