Marker Interface example in Java

Introduction The marker interface pattern is a design pattern that provide run-time type information about objects. It provides a means to associate metadata with a class when there is no…

Externalization example in Java

The Externalizable interface provides the necessary means for implementing a custom serialization mechanism. Implementing the Externalizable interface means that we must override writeExternal() and readExternal() methods. These methods will be…

Simple Log4j Configuration in Java

Introduction We will see here an example on simple log4j configuration in Java. The purpose of inserting log statements into the code is a low-tech method for debugging it. It…

How ThreadLocal Works In Java

Introduction Here you will see how ThreadLocal works in Java. Java ThreadLocal class is used to create thread-local variables. The thread-local variable can be read and written by the same…

String Reverse Example In Java

String Reverse This tutorial will show you string reverse example in Java. You can use various ways to reverse a string in Java and I have presented here five ways…

How HashMap Works In Java

Introduction HashMap (also known as HashTable) is, a data structure that can map keys to values, used to implement an associative array. A HashMap uses a hash function to compute…