Java

“Core Java” is Sun’s term, used to refer to Java SE, the standard edition and a set of related technologies, like the Java VM, CORBA, etc. This is mostly to differentiate from others like Java ME or Java EE. “Core Java” is Oracle’s definition and refers to subset of Java SE technologies.

The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications.

Related Tags

Tutorials

Java Data Types with Examples

Learn about various data types in Java. Learn the differences between primitive datatypes and non-primitive datatypes (or reference datatypes). We will also learn about the data types sizes and best practices for using datatypes in Java. 1. How to Declare a Variable in Java? In Java, typically datatypes are associated …

Introduction to Java Programming Language

Java is concurrent, object-oriented, and intended to let application developers “write once, run anywhere” (WORA). Java is considered a fast language, almost as fast as languages like C and Rust, but it uses a lot of memory in comparison to these languages. 1. What is Java Programming Language Java is …

Java Primitive Datatypes and Ranges

All the values in Java are divided into two categories: reference types and primitive types. Learn about eight Java primitive data types.

Java Callable Future Example

One of the benefits of the Java executor framework is that we can run concurrent tasks that may return a single result after processing the tasks. The Java Concurrency API achieves this with the following two interfaces Callable and Future. In this tutorial, we will learn to execute Callable tasks …

Java Fixed Size Thread Pool Executor Example

In previous tutorial, we learned about basic thread pool executor with unlimited possible number of threads into the pool and it’s example usage. Now lets look example of fixed size thread pool executor which will help in improved performance and better system resource utilization by limiting the maximum number of …

Java Thread Pools and ThreadPoolExecutor

Why do we need a thread pool in Java? The answer is when we develop a simple, concurrent application in Java, we create some Runnable objects and then create the corresponding Thread objects to execute them. Creating a thread in Java is an expensive operation. And if you start creating …

ConcurrentLinkedDeque Example – Non-blocking Thread-safe List

In java, most used data structure is probably a list. A list has an undetermined number of elements and you can add, read, or remove the element of any position. Additionally, concurrent lists allow the various threads to add or remove elements in the list at a time without producing …

Copying a Directory in Java

Learn to copy a directory into a new location in Java. Learn to apply FileFilter to include or exclude subdirectories and specific files.

Java File Checksum – MD5 and SHA-256 Hash Examples

A checksum hash is an encrypted sequence of characters obtained after applying specific algorithms and manipulations on user-provided content. In this Java hashing tutorial, we will learn to generate the checksum hash for the files. 1. Why Generate a File’s Checksum? Any serious file provider provides a mechanism to have …

Making a File Read-Only in Java

Learn to make a file read-only in Java. A read-only file can be opened for reading, but we cannot modify or delete the file contents.

Copying a File in Java

Copying a file from one place to another in Java is a common task. Learn to copy files using Java NIO, Commons-IO and Guava APIs.

Guide to Java BufferedWriter

Learn to create BufferedWriter with default, configure custom internal buffer sizes and write characters data into a file using it.

Guide to Java BufferedReader

Learn to create and operate the BufferedReader instance, set default buffer size and read from a file and system console with examples.

Creating a New File in Java

Learn to create a new file using different techniques including NIO Files and Path, IO File, File OutputStream, and open-source libraries.

Java MappedByteBuffer

Learn about Java memory-mapped files and learn to read and write content from a memory mapped file with the help of RandomAccessFile and MemoryMappedBuffer. 1. Java Memory-mapped IO If you know how java IO works at lower level, then you will be aware of buffer handling, memory paging and other …

Java NIO Vectored IO

Java NIO Channels provide an important new capability known as scatter/gather (referred to in some circles as vectored I/O). Scatter/gather is a simple yet powerful concept. Scatter/gather is a technique through which bytes can be read from a stream into a set of buffers (vectors) with a single read() invocation …

Java NIO Channel Tutorial

Channels are the second major addition to java.nio after buffers which we have learned in my previous tutorial in detail. Channels provide direct connection to the I/O services. A Channel is a medium that transports data efficiently between byte buffers and the entity on the other end of the channel …

Java NIO Buffer Tutorial

Java Buffer classes are the foundation upon which java.nio is built. In this tutorial, we will take a closer look at the buffers. We will discover the various buffer types, and learn how to use them. We’ll then see how the java.nio buffers relate to the Channel classes of java.nio.channels. …

Java Binary Semaphore (+Example)

A binary semaphore is a synchronization primitive that can hold only two values, typically 0 and 1. We use binary semaphore to manage access to a shared resource by multiple threads in a concurrent environment. Conceptually, a binary semaphore can be thought of as a lock that allows only one …

Java Locks (with Examples)

Java provides another mechanism for the synchronization of blocks of code based on the Lock interface and classes that implement it (such as ReentrantLock). In this tutorial, we will see a basic usage of Lock interface to solve printer queue problem. 1. Lock Interface A java.util.concurrent.locks.Lock is a thread synchronization …

Creating Threads Using java.util.concurrent.ThreadFactory

The factory design pattern is one of the most used design patterns in the java. It is one of creational patterns and can be used to develop an object in demand of one or several classes. With this factory, we centralize the creation of objects. The centralization of creation logic …

Java ThreadLocal Example: When and How to Use?

Today, one of the most critical aspects of a concurrent application is shared data. When you create a thread that implements the Runnable interface and then starts various Thread objects using the same Runnable object. All the threads share the same attributes that are defined inside the runnable object. This …

Restarting threads using UncaughtExceptionHandler

1. UncaughtExceptionHandler Java applications have two kind of exceptions – checked exceptions and unchecked exceptions. Checked exceptions must be specified in the throws clause of a method or caught inside them. Unchecked exceptions don’t have to be specified or caught. When a checked exception is thrown inside the run() method …

How Java IO Works Internally?

Learn how Java IO operations are mapped at the machine level; and what all things the hardware does all the time when application is running.

Guide to Java Servlets

Servlets are Java classes that conform to the Java Servlet API, which allows a Java class to respond to requests. Although servlets can respond to any type of request, they are most commonly written to respond to web-based requests. A servlet must be deployed to a Java servlet container in …

Java Regex – Credit Card Number Validation

In this java regular expression tutorial, we will learn to use regex to validate credit card numbers. We will learn about number format and validations of credit card numbers from multiple providers such as VISA, Mastercard, Amex and Diners etc. 1. Valid Credit Card Numbers Formats On an actual credit …

Regex for UK Postal Code Validation

Learn to use regular expressions for UK postcode validation in Java. You can modify the regex to suit it for any other format such as US postal codes.

Java Regex to Validate ISBN

Learn to use regular expressions to test whether a user has entered a valid International Standard Book Number (ISBN).

Regex to Validate SSN (Social Security Number)

In this Java regex tutorial, we will learn to use regular expressions to test whether a user has entered a valid Social Security number in your application or website form. 1. Valid SSN Pattern United States Social Security numbers are nine-digit numbers in the format AAA-GG-SSSS with the following rules. …

Regex to Limit the Number of Lines in Text

In this Java regex tutorial, we will learn to test whether several lines in input text are between some minimum and maximum limit, without regard for how many total characters appear in the string. The regex for matching the number of lines will depend on the exact characters or character …

Java Regex to Limit Number of Words

In this Java regex tutorial, we will learn to test whether the number of words in input text is within a certain minimum and maximum limit.

Regex for Alphanumeric Characters (+ Example)

To create a regular expression that allows only alphanumeric characters, we can use the regex pattern ^[a-zA-Z0-9]+$. This pattern ensures that the string consists solely of uppercase alphabets, lowercase alphabets, and digits. Alphanumeric characters are all alphabets and numbers i.e. letters A–Z, a–z, and digits 0–9. 1. Alphanumeric Regex Pattern …

Java date validation using RegEx

In this Java date validation using regex, we will learn to validate simple date formats such as mm/dd/yy, mm/dd/yyyy, dd/mm/yy and dd/mm/yyyy. Here we want to use a regex that simply checks whether the input is a valid date without trying to eliminate things such as February 31st. We might …

Regex to Validate International Phone Numbers

In this regex tutorial, we will learn to validate international phone numbers based on industry-standard notation specified by ITU-T E.123. The rules and conventions used to print international phone numbers vary significantly around the world, so it’s hard to provide meaningful validation for an international phone number unless you adopt …

Regex for North American Phone Number Validation

In this regex tutorial, we will learn to validate user-entered phone numbers for a specific format (in this example phone numbers are formatted in North American format) and if the numbers are correct then reformat them to a standard format for display. I have tested formats including 1234567890, 123-456-7890, 123.456.7890, …

Java Email Validation using Regex

Simple Java email validation example. Learn to validate email in Java using regular expressions. Five different regex patterns for email validation.

Regex: Matching Exact Word or Contains Word

Java regex word boundary example to match specific word or check if string contain word using Java regular expressions. java regex contain word example. java regex match specific word example.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.