Home » Tag Archives: Core Java

Tag Archives: Core Java

Java NIO Tutorial

1. Introduction Java NIO is a library introduced from Java 1.4. Java NIO has since its launch provided an alternative way to handle I/O and networking transactions. It is considered to be an alternative to Java Networking and Java IO libraries. Java NIO was developed with the goal to make the transactions for input and output asynchronous and non-blocking. The ...

Read More »

JVM Architecture: Execution Engine in JVM

Hello readers! In the previous article of JVM series, developers learned about the Virtual machine’s ClassLoader and Runtime Data Areas components. This tutorial will help developers to correctly understand the Execution Engine in JVM. 1. Introduction Before moving further let’s take a look at the Java Virtual Machine and its basic characteristics. 1.1 What is Java Virtual Machine (JVM)? Java ...

Read More »

JVM Architecture: JVM Class loader and Runtime Data Areas

Hello readers! In the previous article of JVM series, developers learned about the Java Virtual Machine (JVM) and it’s architecture. This tutorial will help developers to correctly answer the questions on below topics: ClassLoader Subsystem Runtime Data Areas 1. Introduction Before moving further let’s take a look at the Java Virtual Machine and its basic characteristics. 1.1 What is Java ...

Read More »

ElasticSearch Tutorial for Beginners

1. Introduction In this example, we shall demonstrate how to make use of Elasticsearch, a distributed free-text search and analysis database engine based on Apache Lucene with a simple maven-based Java client. We will be using the latest version of Elasticsearch, which is ES v6.1.2 while writing this post. For this example we use the following technologies: Maven 3 Java 8 Elasticsearch 6.1.2   ...

Read More »

Performance Comparison of Multithreading in Java

There are different techniques for multithreading in Java. One can parallelize a piece of code in Java either with synchronize keywords, locks or atomic variables. This post will compare performances of using synchronized keyword, ReentrantLock, getAndIncrement() and performing continuous trials of get() and compareAndSet() calls. Different types of Matrix classes are created for performance testing and a plain one also ...

Read More »

Avoid Recursion in ConcurrentHashMap.computeIfAbsent()

Sometimes we give terrible advice. Like in that article about how to use Java 8 for a cached, functional approach to calculating fibonacci numbers. As Matthias, one of our readers, noticed in the comments, the proposed algorithm may just never halt. Consider the following program:               public class Test { static Map<Integer, Integer> cache ...

Read More »