Java Fork/Join Framework and ForkJoinPool with Examples
Java Fork/Join framework with ForkJoinPool examples. RecursiveTask, RecursiveAction, work stealing, thresholds, errors and when to use executors instead.
“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.
Java Fork/Join framework with ForkJoinPool examples. RecursiveTask, RecursiveAction, work stealing, thresholds, errors and when to use executors instead.
java.exe vs javaw.exe on Windows, the console and GUI launchers compared, with output and exit codes, javaw.exe in Task Manager and when to use each.
Calculate age from date of birth in Java with Period.between() and ChronoUnit, plus leap-day birthdays, time zones, parsing and a minimum age check.
Java delete directory recursively with Files.walk() or walkFileTree(), plus Files.delete() for single files, symbolic links, library options and failures.
Tomcat throws taglib definition not consistent with specification version for a misplaced taglib in web.xml. See both cases and the Jakarta EE fix.
Java Base64 encode and decode examples with java.util.Base64 for strings, URL-safe tokens, MIME email, files and streams, plus fixes for decoding errors.
Read a file line by line in Java with Files.lines, BufferedReader, readAllLines and Scanner, plus charsets, MalformedInputException and large files.
Integer overflow in Java wraps values without an error. Detect it with Math.addExact, multiplyExact and toIntExact, and avoid it with long and BigInteger.
Java Stream API examples for creating streams, filter, map, sorted, collectors and groupingBy, lazy evaluation, parallel streams and gatherers on Java 25.
Functional interface in Java explained with @FunctionalInterface, java.util.function types, composition, generic interfaces and checked exceptions.
Java Predicate explained with examples of test(), and(), or(), negate(), Predicate.not(), IntPredicate, BiPredicate and regex asMatchPredicate() in Java 25
Lambda expressions in Java explained with syntax forms, target typing, this vs anonymous classes, effectively final capture, exceptions and Java 25 code
Java IO vs NIO compared for Java 25. Streams vs buffers, blocking vs selectors, NIO.2 Files and Path, virtual threads, and a table of which API to use.
Checked vs unchecked exceptions in Java explained with the Throwable hierarchy, compiler rules, Java 25 examples and when to choose each kind.
Learn labeled break and continue in Java to exit nested loops or skip outer passes, with label scope rules, compile errors, goto and better alternatives.
The serialVersionUID versions a Serializable class in Java. See the declaration rules, InvalidClassException, the computed default, serialver and records.
Convert an InputStream to String in Java with readAllBytes, readAllAsString or BufferedReader, plus String to InputStream and StringReader examples.
Learn why Strings are immutable in Java, how the final String class enforces it, and how the string pool, hash caching, threads and security depend on it.
Use javap to view the bytecode of a Java class file. Learn -c, -p, -v and -l with real JDK 25 output, JAR classes, IDE viewers and the ClassFile API.
Java password hashing done right with PBKDF2, bcrypt, scrypt and Argon2id, OWASP parameters, salts, real timings, and why MD5 and SHA-256 fail.
Java CountDownLatch example with await(), countDown() in finally, timeouts, a starting gate for tests and a comparison with CyclicBarrier and invokeAll.
Learn Java try-with-resources with runnable examples, close order of multiple resources, suppressed exceptions, custom AutoCloseable and JDBC usage.
Polymorphism in Java with overloading and overriding examples, how the compiler and JVM pick methods, what is not polymorphic, and sealed switch.
Learn the Java NIO Path API with Path.of(), getParent(), resolve(), relativize(), normalize() vs toRealPath(), and absolute vs canonical paths in Java 25.
Learn to read and write Excel files in Java with Apache POI 5.5.1, from the Maven dependency to styles, formulas, dates and DataFormatter. Also covers SXSSF and the event API for large files, and the fixes for common POI errors.
Learn to override toString in Java with ToStringBuilder from Commons Lang 3, records, Objects.toString and IDE generation, without leaking passwords.
Read a CSV file in Java the right way. See why split() fails on quoted commas and parse rows with Apache Commons CSV, OpenCSV and Jackson CSV records.
Learn how ConcurrentHashMap works since Java 8, with atomic merge and compute methods, caching, bulk operations, newKeySet, sizing and common mistakes.
Fix java.lang.IncompatibleClassChangeError Implementing class by finding duplicate jars, solving cglib and ASM conflicts and moving to Byte Buddy.
Apache HttpClient 5 examples for REST APIs in Java with GET, POST JSON, PUT, DELETE, headers, basic auth, timeouts, pooling and a java.net.http comparison.
A good HashMap key overrides equals() and hashCode() together, uses fields that never change and spreads its hash codes well. Records, a mutable key that gets lost, collisions, Comparable keys, EnumMap and Lombok, with tested Java 25 code.
Java NIO read file examples. Use Files.readString(), read small and large files with FileChannel and ByteBuffer, decode UTF-8 safely and map large files.
A Java NullPointerException means code used a null reference as an object. Read the helpful NPE message, learn the common causes, and avoid NPEs with requireNonNull, Optional, default values, case null and JSpecify annotations.
Learn to iterate HashMap in Java with entrySet, forEach, keySet and streams, remove entries safely, and compare each way with JMH results on JDK 25.
Detect a loop in a linked list in Java with Floyd’s tortoise and hare algorithm, find the loop start, length and removal, and compare it with a HashSet.
Java suppressed exceptions explained with try-with-resources, getSuppressed() and addSuppressed() examples, stack trace output and suppressed vs cause.
Runnable vs Thread in Java compared with examples, a difference table, shared tasks, executors and virtual threads, and when extending Thread still fits.
Sleep vs wait in Java compared with Java 25 examples, covering which method keeps the lock, the thread states, wake-up rules and modern alternatives.
Object level lock vs class level lock in Java with runnable proof that the two locks are independent, syntax variants, pitfalls and virtual thread notes.
Java pass by value explained with primitives, object references, swap(), Strings, arrays and lists, plus how to return changed values from a method.
Write a palindrome program in Java for strings, phrases and numbers with two pointers, StringBuilder, recursion and streams, without int overflow.
Read XML with the Java SAX parser and DefaultHandler, buffer characters() text correctly, block XXE, validate with XSD and stop parsing early on Java 25.
Java XPath get attribute value examples with @ in the expression. Read one value, all values as a List, numbers, missing attributes and secure parsing.
Build a Java password validation regex with lookaheads, show which rule failed, reject user names safely, and compare it with NIST SP 800-63B-4 rules.
Java regex metacharacters with examples for each one, how to escape them in a Java string, and the split() and replaceAll() bugs they cause.
An enum is a data type with a fixed set of named constants. This Java enum tutorial covers declaring enums, values(), valueOf(), ordinal() and name(), switch and pattern matching on Java 25, constructors, fields and methods, EnumSet, EnumMap, singletons and safe String-to-enum conversion.
Learn where underscores in numeric literals are allowed in Java, the invalid positions, grouping for hex and binary, and parsing 1_000 at runtime.
Send email using Gmail SMTP in Java with Jakarta Mail. Ports 587 and 465, App Passwords, OAuth 2.0, HTML and attachments, tests and common errors.
Learn 7 ways to create an object without the new keyword in Java, which ones skip the constructor, and what is deprecated or internal on Java 25.
Unreachable code in Java fails with the unreachable statement error. See why if (true) compiles but while (true) does not, and how to fix dead code.
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.