CONCURRENCY / CATATAN</>↗Concurrency12 Nov 2025
CompletableFuture is a powerful tool in Java to implement asynchronous programming. It allows you to perform tasks in the background, chain multiple async tasks together, handle both success and failure scenarios, and combine multiple async computations. Here’s a summary of how to use CompletableFuture with examples: 1. Run a task asynchronously Use supplyAsync() (if the […]
LANG PACKAGE / CATATAN</>↗Lang Package12 Nov 2025
The Virtual Threads API is part of Project Loom in the Java platform. With Java 19, virtual threads became available as a preview feature, enabling the creation of lightweight threads that can run concurrently. They work similarly to traditional threads but are much cheaper in terms of memory and thread management because they are managed […]
CONCURRENCY / CATATAN</>↗Concurrency11 Nov 2025
The java.util.concurrent.Flow API, introduced in Java 9, is a low-level implementation of the Reactive Streams specification, providing an asynchronous, non-blocking framework for handling streams of data. It allows you to build reactive systems that support backpressure to handle large or variable amounts of data more efficiently. Here’s a quick guide on how to use java.util.concurrent.Flow […]
JAVA 25 / CATATAN</>↗Java 2510 Nov 2025
The @ImplicitlyDeclared annotation in Java 25 introduces a way to explicitly mark certain declarations as inherently implied by the compiler. It is primarily targeted to pave the way for future enhancements in the Java language, such as compiler-backed, implicit declarations. Purpose of @ImplicitlyDeclared This annotation: Identifies elements (like methods, fields, or constructors) implicitly added for […]
BASIC / CATATAN</>↗Basic08 Nov 2025
Java 25 introduced Enhanced switch Statements to simplify control flow, making type checks, value comparisons, and complex branching cleaner and more expressive. Here’s a guide to simplify control flow using this feature: Key Enhancements in switch Type Pattern Matching: Directly match and work with variable types in patterns. Guarded Patterns: Add conditions (when) to patterns […]
BASIC / CATATAN</>↗Basic07 Nov 2025
String templates in Java 25 introduce a cleaner, more efficient, and safer way to work with strings. They allow embedding expressions inside strings without relying on concatenation or external APIs. Using string templates can lead to code that is easier to understand and maintain. Here’s how you can write cleaner and more efficient code with […]