Home » Java » Page 4

Tag Archives: Java

Finding Spring Versions

In this article, we’re going to discuss Spring Framework and Spring Boot versions and which Java version works on each one. 1. Introduction When you work with the Spring environment, maybe you are familiar with both Framework and Boot. Also, we can use just one of them to create an application as well. But, for sure that what version we ...

Read More »

Java Write String to a File

Bipartite Graph

1. Intruduction In this tutorial, we will see different ways that Java offers to write a String into a file. We’ll make use of BufferedWriter, PrintWriter, FileOutputStream, DataOutputStream, FileChannel, and Temporary File, and the advantages that each one gives us. 2. BufferedWriter Example In this example, we will use the BufferedWriter class. The BufferedWriter class can be used to write a String ...

Read More »

Java for Android Development

Bipartite Graph

In this article, we’re going to talk about the Java tools used for Android development. Table Of Contents 1. Introduction 2. Android Build System 2.1. The build process 3. Build Configurations 3.1 The settings.file 3.2 The build.gradle files 4. Dalvik VM 5. Android Run-Time (ART) 5.1 Ahead-of-time (AOT) compilation 5.2 Garbage collection improvement 5.3 Development and Debugging improvements 6. Where ...

Read More »

JVM Shutdown Hook in Java

Bipartite Graph

This article is a tutorial on implementing a simple JVM Shutdown Hook in Java. In this example, we will take a look at different ways we can terminate a JVM application. 1. Introduction Shutdown Hooks allow developers to plug in the desired code to be executed when the JVM is shutting down. This is useful when we need to do ...

Read More »

Could Not Find or Load Main Class in Java

Bipartite Graph

In this tutorial, we will explain the error: could not find or load main class, the most common runtime exception in Java programming. The error usually occurs if the java command is unable to find or load the class that contains the main() method. 1. Introduction Before digging deep into the solution let us understand a few reasons for this error ...

Read More »

Logical Operators in Java

Bipartite Graph

In this article, we’re going to see the logical operators in Java, which are they, and how to use them through some examples. 1. Introduction As a developer, I see a lot of similar things in a language and logical operators are one of them. Basically, logical operators are used to deciding or validating conditions and return a Boolean to ...

Read More »

Java Thread Dump

Bipartite Graph

In this article, we’re going to see a thread dump in Java. What are the tools available to analyze and make our own code to do that? 1. Introduction A thread dump is a snapshot of the state of all the threads of a Java process. Also, it reveals information about an application’s thread activity that can help us diagnose ...

Read More »

Java ClassLoader Example

Bipartite Graph

In this article, we’re going to discuss different types of Java ClassLoader, how they work and some examples to build our own implementation. 1. Introduction A class loader is an object that is responsible for loading classes. The ClassLoader class is an abstract class that uses a delegation model to search for classes and resources. Furthermore, the ClassLoader is part of JRE ...

Read More »

Array Declaration in Java

Bipartite Graph

This article is about the Array Declaration in Java. But before we initialize an array in java, we will explain one important data structure used, the Array. 1. Introduction An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together. We can store in an array any ...

Read More »

How to Generate a Random Int in Java

Bipartite Graph

This article shows how to generate a random Int or integer in Java using different approaches. 1. Introduction Java has several ways to generate a random Integer, primitive or wrapped object, on its environment. Here we’ll see some of these methods listed below: Random classMath classThreadLocalRandom class 2. Pre-requisites The minimum Java version for execute this article’s example is JDK ...

Read More »