Home » Java » Core Java

Core Java

Minborg’s Java Pot

 In Java 21, old code might run significantly faster due to recent internal performance optimizations made in the Java Core Libraries. In this article, we will take a closer look at some of these changes and see how much faster your favorite programming language has become. Buckle up, for we are about to run at full speed! Background When converting ...

Read More »

Java and dynamic Proxies

Dynamic proxies in Java is a simple and very useful feature. Usually we create an interface implementation and then compilation is involved. With dynamic proxies we can implement a list of interfaces at runtime. A proxy object will be created, when a method is invoked on that proxy instance, the methods invoked will be forwarded to an invocation handler specified. ...

Read More »

Java Concurrency: Threads and Runnables

Threads are everywhere, they are the basic building block of every server application out there. Usually in Java using threads is just a combination of Executors and Runnables however let’s have a closer look on a thread and how it works. Supposing I want to start a thread, it can be as simple as this. Thread thread = new Thread(() ...

Read More »

Minborg’s Java Pot

Did you know you can allocate memory segments that are larger than the physical size of your machine’s RAM and indeed larger than the size of your entire file system? Read this article and learn how to make use of mapped memory segments that may or may not be “sparse” and how to allocate 64 terabytes of sparse data on ...

Read More »

Manage multiple Java SDKs with asdf with ease

asdf is a helpful command-line tool that allows you to manage and switch between different versions of programming language runtimes including Java, Kotlin, Node.js, Python and their associated packages and libraries including Gradle, Maven, Yarn, Spring Boot CLI. asdf is supported for all major operating systems including Windows via Windows Subsystem for Linux 2 (WSL2). Depending on your setup (OS, ...

Read More »

Project Loom in JDK-19: the benefits but with quirks

A few months have passed already since JDK-19 release, which we talked about previously in details. More and more developers are switching to JDK-19, turning their heads towards Project Loom and starting to play with virtual threads and structured concurrency (despite the incubation / preview status of these features). And it certainly makes sense, sooner or later, the JVM and ...

Read More »

Bigtable Pagination in Java

 Consider a set of rows stored in Bigtable table called “people”: My objective is to be able to paginate a few records at a time, say with each page containing 4 records: Page 1: Page 2: Page 3: High-Level Approach A high level approach to doing this is to introduce two parameters: Offset — the point from which to retrieve ...

Read More »

Java 19: Virtual Threads

Java 19 introduces Virtual Threads, which are lightweight threads designed to improve application throughput. This is a preview language feature so must be enabled using --enable-preview. As you know, the JDK implements platform threads (java.lang.Thread) as thin wrappers around operating system (OS) threads. OS threads are expensive to create, and the number of threads is limited to the number of ...

Read More »

Design Patterns Cheatsheet

1. Introduction Design patterns are reusable solutions to common software design problems. They provide a way to describe and document software architectures, as well as a common vocabulary for developers to communicate about software design. There are several types of design patterns, including creational, structural, and behavioral patterns. Creational patterns deal with object creation mechanisms, trying to create objects in ...

Read More »