Core Java

Reverse Elements Of Java Array

Overview: In this quick tutorial, we’ll learn ways in which we can invert or reverse an array. We’ll first look at the most basic Java implementations and later cover a few third-party options. Problem Definition: Consider we have an array of elements: Integer[] intArr = {12, 30, 1, 7, 4}; Our problem is to be […]

Be the First to comment. Read More
Other Tutorials

Maven Resources Plugin

Introduction: In this tutorial, we’ll learn about Maven Resources Plugin. We’ll start by learning what it is used for and finally learn to configure it in our own Maven project. So let’s start by understanding what’s a resource? Resources are non-source code files like xmls, images, property files etc that we use in our projects. […]

Be the First to comment. Read More
Other Tutorials

Guide to Maven Compiler Plugin

1. Introduction: Maven Compiler plugin is one of the core plugins of Apache Maven. It helps us to compile the sources of our maven project. It uses javax.tools.JavaCompiler as its default compiler. If we wish to use javac as the compiler, we can set forceJavacCompilerUse option value to true. 2.Compiler Plugin Goals: The Maven Compiler […]

Be the First to comment. Read More
Core Java

“final” Keyword In Java

Introduction: The final keyword in Java is a non-access specifier. We can apply it to a variable, method or a class. In this tutorial, we’ll learn its usage in each of these contexts. final Variable: The variables declared as final are nothing but constants i.e. any attempt to reassign a value to those variables will […]

Be the First to comment. Read More
Core Java

Comparing Strings In Java

Introduction: Strings are used all over in any Java application. So, it’s important to understand how to compare two string objects. In this article, we’ll learn ways to compare String objects.   1.) Comparing References Using ‘==’ The == operator when used to compare strings is responsible for comparing only the references(not the content). So […]

Be the First to comment. Read More
Core Java

Find Sum/Average In Java Array

Introduction: In this article, we’ll learn to find the sum and average of all elements in a given Java array. We’ll first cover the basic for loop-based approach and then extend our knowledge to achieve the same using Java Streams API. Finding Sum of Elements In Array: Let’s look at how we can find the […]

Be the First to comment. Read More
Core Java

Find Maximum/Minimum Element In Java Array

Introduction: In this quick tutorial, we’ll learn ways to find the maximum/minimum element in a Java array of primitives. We’ll start with the very basic algorithms and end up with a solution using Java 8 Streams API.   Approach 1:: Linear Search It is a pretty straightforward approach to find max/min elements in a given […]

One comment Read More
Other Tutorials

KeyStore vs TrustStore In Java

Introduction: The two terms truststore and keystore are often confused and seem daunting to even many senior developers at first. In this tutorial, we’ll cover the differences between a truststore and a keystore. We also suggest you read our article on How Https Works – SSL/TLS, which will help you understand the basics of Http […]

Be the First to comment. Read More
Core Java

Java 9 New Features

Introduction: Oracle Java 9 has a large set of new features including the various upgrades to the programming tools and libraries. In this tutorial, we’ll have a look at a few of those features. 1.) Java 9 REPL(JShell) Let’s cover the fun part first! In Java 9, Oracle introduced a tool called REPL(Read Evaluate Print […]

Be the First to comment. Read More
Core Java

Java 8 groupingBy Collector

Introduction: GroupingBy Collectors introduced in Java 8 provides us a functionality much similar to using GROUP BY clause in a SQL statement. It helps us group objects based on certain property, returning a Map as an outcome. In this article, we’ll look at various example usages of the groupingBy collector in Java 8. To follow […]

Be the First to comment. Read More