Kotlin Java Interoperability
1. Overview In this tutorial, we’re going to discuss the interoperability between Java and Kotlin. We’re going to cover some basic examples as well as some other more complex scenarios. 2. Setting up...
View ArticleHashSet and TreeSet Comparison
1. Introduction In this article, we are going to compare two of the most popular Java implementations of the java.util.Set interface – HashSet and TreeSet. 2. Differences HashSet and TreeSet are...
View ArticleGuide to the Most Important JVM Parameters
1. Overview In this quick tutorial, we’ll explore the most well-known options which can be used to configure the Java Virtual Machine. 2. Explicit Heap Memory One of the most common...
View ArticleGuide to the ConcurrentSkipListMap
1. Overview In this quick article, we’ll be looking at the ConcurrentSkipListMap class from the java.util.concurrent package. This construct allows us to create thread-safe logic in a lock-free way....
View ArticleHow to Perform a Simple HTTP Request in Java
1. Overview In this quick tutorial, we’re going to present a way of performing HTTP requests in Java — by using the built-in Java class HttpUrlConnection. 2. HttpUrlConnection The HttpUrlConnection...
View ArticleDifference Between Wait and Sleep in Java
1. Overview In this short article, we’ll have a look at the standard sleep() and wait() methods in core Java, and understand the differences and similarities between them. 2. General Differences...
View ArticleLongAdder and LongAccumulator in Java
1. Overview In this article, we’ll be looking at two constructs from the java.util.concurrent package: LongAdder and LongAccumulator. Both are created to be very efficient in the multi-threaded...
View ArticleJava Annotations Interview Questions (+ Answers)
1. Introduction Annotations have been around since Java 5, and nowadays, they are ubiquitous programming constructs that allow enriching the code. In this article, we’ll review some of the questions,...
View ArticleUsing Java MappedByteBuffer
1. Overview In this quick article, we’ll be looking at the MappedByteBuffer in the java.nio package. This utility can be quite useful for efficient file reads. 2. How MappedByteBuffer Works When we’re...
View ArticleDynamic Proxies in Java
1. Introduction This article is about Java’s dynamic proxies – which is one of the primary proxy mechanisms available to us in the language. Simply put, proxies are fronts or wrappers that pass...
View ArticleHow to Copy an Array in Java
1. Overview In this quick article, we’ll discuss different array copying methods in Java. Array copy may seem like a trivial task, but it may cause unexpected results and program behaviors if not done...
View ArticleSpring Boot and Togglz Aspect
1. Overview In this tutorial, we’re going to take a look at how the Togglz library can be used with a Spring Boot application. 2. Togglz The Togglz library provides an implementation of the Feature...
View ArticleQuick Guide to Spring Roo
1. Overview Spring Roo is a Rapid Application Development (RAD) tool that aims to deliver fast, and instant results focused on Spring web applications and newer Spring technologies. It allows us to...
View ArticleJava Web Weekly, Issue 175
Lots of interesting writeups on Java 9 this week. Here we go… 1. Spring and Java >> IBM and Red Hat to Vote “No” on Java Modules (Jigsaw) [infoq.com] Java 9 is scheduled to be released 3 months...
View ArticleIntroduction to JDBC
1. Overview In this article, we’re going to take a look at JDBC (Java Database Connectivity) which is an API for connecting and executing queries on a database. JDBC can work with any database as long...
View ArticleGuide to CopyOnWriteArrayList
1. Overview In this quick article, we’ll be looking at the CopyOnWriteArrayList from the java.util.concurrent package. This is a very useful construct in the multi-threaded programs – when we want to...
View ArticleAngular 4 Upgrade for Spring Security OAuth
1. Overview In this quick tutorial, we’re going to upgrade our existing Angular application described here, to use Angular 4 instead of AngularJS. 2. Setup Angular4 First, we’ll use Angular CLI to...
View ArticlePeriod and Duration in Java
1. Overview In this quick tutorial, we’re going to take a look at two new classes for working with dates introduced in Java 8: Period and Duration. Both classes can be used to represent an amount of...
View ArticleConverting a Stack Trace to a String in Java
1. Introduction When dealing with exceptions in Java, we’re frequently logging or simply displaying stack traces. However, sometimes, we don’t want just to print the stack trace, we might need to...
View ArticleGuide to Java Data Objects
1. Overview The Java Data Objects is an API designed for persisting object-oriented data into any database and provide a user-friendly query language using the Java syntax. In this article, we are...
View Article