Sitelet https://howtodoinjava.com/java/

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

SimpleDateFormat setLenient(false): Strict Date Validation

SimpleDateFormat is lenient by default, so parse() turns 02/30/2026 into March 2 without an error. Call setLenient(false) for strict date validation, and add a ParsePosition and round-trip check for the inputs strict mode still accepts.

Java Tutorial for Beginners: Learn Java 25 Step by Step

A Java tutorial for beginners on Java 25, the current LTS release. Install JDK 25, write a first program as a compact source file and as a classic class, add a JUnit 6 test, and follow a 12-step learning path to the best howtodoinjava tutorials for each topic.

Convert Date and Time to EST/EDT in Java (EST5EDT vs EST)

To convert a date and time to EST in Java, convert it to a ZonedDateTime in America/New_York, which switches between EST (UTC-5) and EDT (UTC-4). Learn why the EST zone ID gives the wrong hour, how EST5EDT differs and how to print EST, EDT or ET.

Java Read File to String: Files.readString() and 6 More Ways

To read a file into a String in Java, call Files.readString(path) on Java 11+, or new String(Files.readAllBytes(path), UTF_8) on Java 7 and 8. Examples for Files.lines(), BufferedReader, Commons IO and Guava, plus charset and error handling.

ArrayList Replace at Index in Java: set() and replaceAll()

Replace an element in a Java ArrayList with set(index, element), which returns the old element. Find the index by value with indexOf(), replace all matches with Collections.replaceAll() or List.replaceAll(), and avoid IndexOutOfBoundsException.

Java LocalDate: First and Last Day of Week, Month or Year

Get the first and last day of a week, month or year in Java by passing a TemporalAdjusters method such as firstDayOfMonth() or lastDayOfYear() to LocalDate.with(). Learn how the week start changes by locale, and how to use YearMonth, quarters and range queries.

How to Compare Dates in Java (With and Without Time)

Compare two dates in Java with isBefore(), isAfter() and isEqual() on LocalDate, LocalDateTime, ZonedDateTime or Instant, and with before(), after() and compareTo() on Date and Calendar. Learn to compare without time, check a date range and sort dates.

Java UnsupportedOperationException: Causes and Fixes

UnsupportedOperationException is an unchecked exception that lists from Arrays.asList(), List.of() or Stream.toList() throw when the code changes them. Learn the causes, how to read the stack trace and how to fix it with a modifiable copy.

Case-Insensitive Map in Java (TreeMap, Commons, Spring)

A case-insensitive map in Java treats String keys such as “Lokesh” and “LOKESH” as the same key. Create one with a TreeMap and String.CASE_INSENSITIVE_ORDER, Apache Commons CaseInsensitiveMap or Spring LinkedCaseInsensitiveMap.

Module Import Declarations in Java 25: import module

A module import declaration such as import module java.base; imports every package a module exports with one line, and it is final in Java 25. Learn what it imports, how to fix “reference to List is ambiguous” with a single-type import, and how it works with java.se and compact source files.

NoSuchMethodError in Java: Causes, Diagnosis and Fix

java.lang.NoSuchMethodError means code compiled against one version of a class runs with another version that lacks the called method. Learn to read the message, find the wrong jar with mvn dependency:tree, -verbose:class and javap, and fix the conflict with a BOM, an exclusion and the Enforcer dependencyConvergence rule.

StackOverflowError in Java: Causes, Stack Trace and Fixes

A StackOverflowError means a thread made more nested calls than its stack can hold. Learn to read the repeating stack trace, fix missing base cases, deep recursion and object cycles in toString(), Lombok and Jackson, and when -Xss helps.

IllegalArgumentException in Java: Real Causes and Fixes

IllegalArgumentException is the unchecked exception a Java method throws when an argument has a value it does not accept. This post lists the JDK calls that throw it with their real Java 25 messages and the fix for each, the subclasses such as NumberFormatException, and when our own code should throw it instead of IllegalStateException or NullPointerException.

Java CompletableFuture Tutorial with Examples (Java 25)

A CompletableFuture is a Future that runs the next step when its result arrives, so no thread has to wait for it. This tutorial creates, chains and combines CompletableFuture tasks on virtual threads, handles errors and timeouts, and shows the mistakes that make async code hang or lose exceptions.

Java 25 Migration: Upgrade From Java 21 Step by Step

A Java 25 migration is mostly a build change. This step-by-step guide upgrades a Maven project from Java 21 to Java 25, shows the support dates, and fixes the real errors from Lombok, Mockito and JaCoCo on the way.

Java 25 Features (LTS): All 18 JEPs With Code Examples

Java 25 is the LTS release of September 2025 with 18 JEPs. This guide runs every one of them, from compact source files, module imports, flexible constructors and scoped values to compact object headers, AOT caches and the new JFR events, and shows the preview features with their –enable-preview flags. It ends with the features that became final between Java 21 and 25 and a migration checklist.

Java 26 Features: All 10 JDK 26 JEPs with Code Examples

Java 26 (JDK 26) shipped on 17 March 2026 as a non-LTS release with 10 JEPs. This overview lists every JEP with its status and shows short, runnable examples for HTTP/3, final field warnings, the AOT cache with ZGC and the preview APIs.

Java 27 Features: All 9 JEPs in JDK 27 with Examples

Java 27 (JDK 27) reached general availability on 15 September 2026 with nine JEPs. Four final JEPs change JVM defaults (G1 everywhere, compact object headers, post-quantum TLS, JFR redaction), and five continue as previews or incubator. A summary table, one example per feature and the removed options.

Java List Initialization in One Line: List.of and ArrayList

Initialize a Java List in one line with List.of() for an unmodifiable list, or new ArrayList<>(List.of(…)) when the list changes later. Compare Arrays.asList(), Stream.toList(), Collections and Guava by mutability and null support.

Unsupported Class File Major Version 69: Fix for Java 25

“Unsupported class file major version 69” means a JVM or bytecode tool older than Java 25 tried to read a Java 25 class file. Learn to read the class file version, map it to the Java release, and fix the error by upgrading the runtime, compiling with –release, or upgrading Gradle, Spring, JaCoCo, Mockito and Lombok.

Kubernetes for Beginners: Hands-On Guide With Spring Boot

A hands-on Kubernetes guide for Java developers: deploy a Spring Boot API and PostgreSQL to a local kind cluster and learn pods, Deployments, Services, Ingress, ConfigMaps, Secrets, volumes and StatefulSets with real kubectl output.

Spring Boot: Import Excel File into Database (Apache POI)

Upload an .xlsx class roster to a Spring Boot endpoint, read it with Apache POI, validate every row with Bean Validation and save the valid rows in JDBC batches. Includes a JSON error report, duplicate checks, a SAX reader for large files with measured heap, upload limits and MockMvc tests.

Spring Boot Hibernate 7 Example with Spring Boot 4.1

Set up Hibernate 7.4 in a Spring Boot 4.1 application: the JPA starter, datasource and JPA properties, entities, Spring Data repositories, transactions, the Session API, SQL logging, tests on H2 and MySQL, and the Hibernate 7 upgrade changes.

Spring Boot Virtual Threads: Setup, Load Test and WebFlux

One property, spring.threads.virtual.enabled=true, moves Spring Boot requests, @Async methods and scheduled tasks to virtual threads. A weather API measured against platform threads and WebFlux, plus pinning and monitoring on Java 25.

Java Random Number Generators in Multithreaded Code

A shared Random is thread-safe but makes every thread fight over one seed. Learn which generator each thread should use, how to keep seeded results reproducible, and what a JMH benchmark measured on Java 25.

Selenide IllegalArgumentException: Failed to create folders

The error “java.lang.IllegalArgumentException: Failed to create folder” in Selenide typically happens when Selenide tries to save screenshots, page sources, or logs, but it cannot create the required directories due to permission issues or incorrect paths.

Angular UI Testing using Selenium and Selenide

In-browser UI testing of Angular applications poses several challenges such as asynchronous operations and unpredictable loading screens with spinners or dimmers.
Selenide has an implicit capability to wait for the loading screen to disappear.

Java Object Equality without Public Fields or Getters

As a best practice in Java, POJO classes or Data objects always declare the fields private and expose their access through the getter methods. On rare occasions, we may encounter situations when the member fields are private, and the class does not provide the public accessor methods. For example, the …

How to Create Immutable Map in Java?

Learn to create an immutable or unmodifiable Map using the factory methods added in Java 9 and other versions (Java 8 to Java 21) with examples.

Serialize Object to String in Java

In Java, we can serialize an object to String in different ways such as converting to byte[] and thenBase64 encoded string, XML or JSON. Learn with examples.

Filter Nested Collections with Stream in Java

Java Stream API provides excellent filtering capability on the elements in the Stream. Sometimes, the stream elements also contain the nested collections; we need to filter those elements in the nested collections. This Java tutorial discusses various approaches with examples to apply filtering on nested collections and collecting the filtered …

Java Stream mapMulti() Example

Stream mapMulti() is a specialized form of the map() method that transforms each element of a stream into one or multiple output elements or none at all.

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.