X

Java Overview

This is the first Java tutorial from a series of tutorials for beginners. If you want to learn Java in a…

filip

Java Eclipse Tutorial

In this tutorial I will show you how to simplify your Java programming with Eclipse IDE. (more…)

filip

Eclipse Shortcuts

This list contains the most common eclipse shortcuts for Windows, Linux and Mac OS. Using shortcuts will improve your coding efficiency. You…

filip

Install Java 8 JDK on Ubuntu

In this tutorial you will learn how to install latest Java 8 on Ubuntu or LinuxMint via PPA. (more…)

ym_coding

Simple Java Example

This tutorial will explain how to download and install Java on your computer. We will also show you how simple…

filip

Java Primitive Types

In this tutorial, you will learn about Java primitive types and how to choose the right one. (more…)

filip

How to install Maven on Windows, Linux and Mac

In this tutorial, we will be going through the installation process of Maven. If you are a WINDOWS user (if…

ym_coding

How to use Maven profiles

Simply said, Maven profile is a set of configuration value which override default values. By using it, it allows you…

ym_coding

How to include custom library into maven local repository

If you've ever wondered whether you can upload your own libraries as a dependency using Maven, the answer is yes,…

ym_coding

How to use JUnit for unit testing

What is software testing and why is it useful? Testing software in the simplest terms is to evaluate whether it…

ym_coding

How to run JUnit test with Maven

This tutorial will cover how to run Unit tests using the Maven’s Surefire plugin. If you are not familiar with…

ym_coding

How to create submodules with Maven in Java

What you will need. IDE or a text editor JDK 1.8 or above Maven What exactly is Maven’s multi-module? This…

ym_coding

How to create Java JAR file with Maven

We do not normally need additional dependencies when it comes to creating an executable jar. All we need to do is…

ym_coding

How to create Java WAR file with Maven

Before proceeding with the next steps, make sure you have JDK and Maven installed on your system. If you don't…

ym_coding

JVM Explained

This article describes the Java Virtual Machine (JVM) and its architecture (more…)

filip

Java Memory Model Explained with Examples

Memory can be described as an array of bytes where you can access each byte individually. In each byte or…

ym_coding

Top 3 Methods for Capturing Java Heap Dump

In this post, I’ll teach you multiple methods for capturing java heap dump. Critical for memory consumption optimisation, a heap…

filip

Java Loops

This tutorial explains how Java loops are created and how did they work. (more…)

filip

Java Garbage Collection

This article discusses about Java Garbage Collection (GC) which is considered as one of the complex topics in Java programming…

Samyam_

Java Array

In this tutorial I will show you how to create and use arrays in Java (more…)

filip

Java Read File Example

In this example I will show you how to read files using the Java programming language. (more…)

filip

Java Mutex Example

Let's give an example first before going deeper into what Mutex is: Think of a queue. Doesn't matter short or…

ym_coding

Java Semaphore example

Semaphore can be used to limit the amount of concurrent threads and essentially, this class maintains a set of permits.…

ym_coding

Java Parallel Streams Example

Stream API allows developers to  take advatange of multi core architectures and improve the performance of Java program by  creating…

ym_coding

Java thread synchronization

This article talks about the importance of thread synchronization in Java and how you can implement it in your programs.…

Samyam_

Java Thread Pool Example

Active threads consume system resources, which can cause JVM creating too many threads which means that the system will quickly…

ym_coding

ThreadLocal Java Example

ThreadLocal is a class that provides thread local variable and is used to achieve thread safety. The data stored will…

ym_coding

Livelock and Deadlock In Java

The following article talks about the livelock and deadlock states in java, how they occur and what can be done…

Samyam_

Java Future Example

The result of an asynchronous computation is called Future and more specifically, it has this name because it (the result) will be…

ym_coding

Java equals() Method Example

Java equals() method and the "==" operator are both used to compare objects for equality. However, they are doing the…

ym_coding

Java Lambda Expressions Tutorial

Java 8 introduced Lambda Expressions and is one of the biggest, if not the biggest, feature that was introduced because…

ym_coding

Java Optional Example

Java 8 introduced Optional class which is used to manipulate data based on whether a value is present or absent.…

ym_coding

Java 11 HTTP Client Example

Java 11 introduced the HTTP Client which can be used to send requests over the network and retrieves their responses.…

ym_coding

Java JDBC CRUD Tutorial

This tutorial will help you understand how to perform basic database operations such as Create, Retrieve, Update and Delete (CRUD)…

ym_coding

Java Objects and Classes Tutorial

In this tutorial, I will explain the fundamentals of java classes and objects. (more…)

filip

What is Object Oriented Programming (OOP)

Follow this tutorial to understand the principles of object oriented programming and write reusable and clean code (more…)

filip

Java Encapsulation Example

This example demonstrates the usage of encapsulation in Java programming language (more…)

filip

Java Interface Example

In this tutorial I will show you how to create and work with Java Interfaces. As always I will demonstrate…

filip

Java Inheritance Example

This example demonstrates the usage of inheritance in Java programming language (more…)

filip

Java Abstraction Example

This example demonstrates the usage of abstraction in Java programming language (more…)

filip

Java Polymorphism Example

This example demonstrates the usage of polymorphism in Java programming language (more…)

filip

Method Overloading vs. Method Overriding in Java

This article demonstrates the difference between method overloading and method overriding in Java with examples (more…)

filip

Java Control Flow Statements

Control flow statements in Java allow you to run or skip blocks of code when special conditions are met. You…

filip

Java Class Loaders Explained

This article explains the key components of Java class loaders. (more…)

filip

Java Enum Example

Enum type is a special data type which holds different constants such as WHITE, BLACK, RED. The convention is that…

ym_coding

Java hashCode() Method Example

The super class in Java java.lang.Object provides two important methods for comparing objects: equals() and hashcode(). These methods are widely used when faced against implementing…

ym_coding

How to profile standalone java applications

What are unit tests? Unit tests are a method of software testing in which small components of a Java application…

ym_coding

How to profile remote java applications

What is profiling? Profiling examines an application and tries to locate memory or performance issues that are associated with a…

ym_coding

SWING JFrame basics, how to create JFrame

This tutorial explains JFrame basics from creation to customization. (more…)

NeelumAyub

Java SWING JFrame Layouts Example

This tutorial explains various JFrmae layouts with examples and use. (more…)

NeelumAyub

Display text and graphics in Java on JFrame

This tutorial explains how to display text and graphics on JFrmae for example, lines, circle and rectangle. (more…)

NeelumAyub

Interact with JFrame – buttons, listeners and text fields

This tutorial explains how you can interact with JFrame by using buttons, listeners and text fields. (more…)

NeelumAyub

How to create Java JAR file with Maven

This tutorial will explain how to create Java JAR file with Maven with step by step guidelines and screen shots.…

NeelumAyub

Java Collection Beginner’s Guide

The "Collections" framework in Java came into action with the release of JDK 1.2 and was expanded quite a few…

filip

Choose the Right Java Collection

Java offers you a variety of collection implementations to choose from. In general you will always look for the collection with…

filip

Java ArrayList Example

Java ArrayList class is a resizable array that implements the List interface. It permits all elements, including null and also…

ym_coding

Java LinkedList Example

LinkedList class in Java uses a doubly linked list to store elements and it also provides a linked-list data structure.…

ym_coding

Java HashSet Example

Collections that use a hash table for storage are usually created by the Java HashSet class. As the name suggests,…

ym_coding

Java TreeSet Example

Java TreeSet class is a NavigableSet implementation that is based on TreeMap. The elements are either ordered by a Comparator…

ym_coding

Java LinkedHashSet Example

LinkedHashSet class in Java differs from HashSet as its implementation maintains a doubly-linked list across all elements. This linked list…

ym_coding

Java EnumSet Example

Java EnumSet class implements Set and uses it with enum types. EnumSet (as the name suggests) can contain only enum values and…

ym_coding

Java ConcurrentHashSet Example

Java 8 finally allows us, the programmers, to create thread-safe ConcurrentHashSet in Java. Before then, it was simply not possible.…

ym_coding

Java HashMap Example

Arrays' items are stored as an ordered collection and we can access them by indices. HashMap class in Java on…

ym_coding

Java LinkedHashMap Example

LinkedHashMap is a combination of hash table and linked list that implement the Map interface with predictable iteration order. The…

ym_coding

Java TreeMap Example

TreeMap implements the Map interface and also NavigableMap along with the Abstract Class. The map is sorted according to the…

ym_coding

Java EnumMap Example

EnumMap class implements the Map class and enables the use of enum type keys. Enum maps are maintained in the natural…

ym_coding

Java WeakHashMap Example

WeakHashMap in Java implements the Map interface and represents a hash table that has weak keys. If a key is not in…

ym_coding

Java IdentityHashMap Example

IdentityHashMap implements the Map interface and two keys are considered equal when checked as k1==k2 (not by using equals method). This itself violates…

ym_coding

Java SortedMap Example

SortedMap interface extends Map and ensures that all entries are in an ascending key order (hence SortedMap). If you want…

ym_coding

Java ConcurrentMap Example

Even though Map is implemented by many classes, many of them are not thread-safe or some of them are but not efficient.…

ym_coding

Java Hashtable Example

Hashtable implements a hash table (as the name suggests) and maps keys to values (like LinkedHashMap). Hashtable class allows non-null…

ym_coding

Difference Between ArrayList and LinkedList in Java

This article explains the differences between ArrayList and LinkedList and in which case we should prefer the one over the…

filip

Java Iterate through a HashMap Example

This examples shows you how to iterate through a HashMap in Java (more…)

filip

Java HashMap Inline Initialization

Following examples demonstrate how to initialize a Java HashMap using standard and inline methods. (more…)

filip

Difference between HashMap and TreeMap in Java

In this article I will explain the difference between java HashMap and java TreeMap (more…)

filip

Graphs Java Example

Graphs are usually made from vertices and arcs. Sometimes they are also called nodes (instead of vertices) and edges (instead…

ym_coding

Depth-First-Search Example Java

Searching and/or traversing are equally important when it comes to accessing data from a given data structure in Java. Graphs…

ym_coding

Breadth-First-Search Example Java

Searching or traversing is really important when it comes to accessing data from a given data structure. There are different…

ym_coding

Different Algorithm Time Complexities

Before starting to explain the different time complexities, let's first look at what an actual algorithm is. The formal definition…

ym_coding

Java Serialization example

Serialized object. What does that mean? Java provides a functionality which represents an object as a sequence of bytes which…

ym_coding

Java Reflection Example

Reflection (which is a feature in Java) allows executing Java program to examine itself (or another code) and manipulate internal…

ym_coding

Weak references in Java

This article discusses the concept of weak references in Java. (more…)

Samyam_

Java 8 Date Time API

Java 8 introduced a new Date-Time API which purpose is to cover drawbacks of the old date-time API. The previous…

ym_coding

Basic Java Regular Expressions

Today I will show you the very basics of Regular Expressions and how to use them in Java. (more…)

filip

Retrieve Free Disk Space with Java

Sometimes you wish to know how much disk space is left on your hard drive. There are several ways to…

filip

Java generate MD5 hash sum

In this example I will show you how to generate the MD5 hex sum for a given string using Java…

filip

Java Increase Memory

The Java memory model specifies how the Java virtual machine works with the computer's memory (RAM). In this tutorial I…

filip

Java Properties File Example

In this tutorial I will show you how to store and retrieve values from a properties file in Java (more…)

filip

How to Install Java 9 Beta on Eclipse

This tutorial demonstrates how to install and configure Java 9 Beta on Eclipse Oxygen (more…)

filip

Java 9 JShell Example

This tutorial explains how to use the JShell tool in Java 9 (more…)

filip

Java 9 Immutable List Example

This example demonstrates how to create immutable lists with the new Java 9 Collections factory methods (more…)

filip

Java 9 Immutable Set Example

This example demonstrates how to create immutable Set with the new Java 9 Collections factory methods (more…)

filip

Java 9 Immutable Map Example

This example demonstrates how to create immutable Map with the new Java 9 Collections factory methods (more…)

filip

Java Singleton Design Pattern Example

As we know design pattern are created to solve a specific problem. Singleton solve the problem of creating only one…

filip

Java Proxy Design Pattern Example

This article describes the proxy design pattern in java. (more…)

filip

Java Observer Design Pattern Example

The Observer pattern is a software design pattern in which an object, called the subject, maintains a list of all…

filip

Java Factory Design Pattern

This article talks about the factory design pattern in Java which is one of the popular design patterns used in…

filip

Java Builder design pattern

Here we will talk about the Java Builder design pattern, where and how it should be used. (more…)

Samyam_

Java Comparator Example

in this tutorial, we will discuss java comparator and its examples. What is Java Comparator? Java Comparator is an interface…

asimassu101

Java Send Email Example

The JavaMail API "pp"-independent(platform and protocol) framework which purpose is to help build messaging and mail applications. It is (more…)

ym_coding