Home » Core Java

Core Java

Java 8 API Tutorial

In this article, we are going to explain the Java 8 API through examples. 1. Introduction Java 8 was released on March 18, 2014 with several enhancements. In this example, I will demonstrate the following API enhancements: Support Functional programming with Lambda Expression, Functional Interface, and Stream APINew Java Date APIInterface’s Default Method 2. Technologies Used The example code in ...

Read More »

Java Write String to a File

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 »

SQL Between, MySQL Between Dates, Not Between

In this example, we will see how to use the BETWEEN operator included in the SQL. 1. Introduction The BETWEEN is a logical operator, often used in the WHERE clause of the SELECT, UPDATE, and DELETE statements, and gives us the ability to specify whether a value is in a given range or not. Syntax SELECT column_name(s) FROM table_name WHERE column_name ...

Read More »

Java for Android Development

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 »

Java Swagger Parser Tutorial

In Java, a parser is a program or a library that takes in a file (JSON, XML, txt, etc) and converts it to java objects. In this article, we will see how to parse a swagger JSON file. 1. Introduction It is difficult to write parsers for unstructured data. For example, if you are receiving a text file that has ...

Read More »

JVM Shutdown Hook in Java

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 »

Internationalization in Java

In this article, we are going to explain Internationalization in Java. 1. What are Internationalization and Localization? Internationalization, or I18N for short, is the broad term for the techniques and processes involved in building applications that are easily adaptable to different cultural norms and/or preferences. The process of actually adapting an application to a particular set of cultural norms is ...

Read More »

The Ternary Conditional Operator ? : in Java

In this article, we will explore the ternary operator ?(question mark) and :(colon) in Java, what is its purpose, and why do we use it? 1. What is a Ternary Operator? The operator ? : in Java, is a ternary operator. It uses to evaluate a boolean expression. It is also known as a conditional operator. It consists of three ...

Read More »

How to create an array of objects in Java

In this article, we will show how to create an array of objects in Java. 1. Introduction Everything in Java is associated with classes and objects, along with its attributes and methods. A Class is like an object constructor or a “blueprint” for creating objects. A typical Java program creates many objects, which as you know, interact by invoking methods. ...

Read More »