Understanding JVM Garbage Collection Algorithms and Collectors

Garbage Collection Algorithms Mark-Sweep Algorithm Characteristics: Fast collection speed Causes memory fragmentation, making large contiguous allocations difficult Process: First pass marks reachable objects from GC roots Second pass sweeps and reclaims memory from marked objects Mark-Compact Algorithm Advantages: Eliminates memory fragme ...

Posted on Tue, 15 Sep 2026 16:09:17 +0000 by parboy

Java.util.ArrayList Source Code Analysis

Class Inheritance Structure The ArrayList class definition is as follows: public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable {} The interfaces implemented by ArrayList have been covered in previous sections, so they won't be elaborated on here. Key Member Va ...

Posted on Mon, 14 Sep 2026 16:53:38 +0000 by ziesje

Analyzing WeChat Withdrawal Fees with Java Code

A recent discussion about WeChat wallet withdrawal fees sparked an interesting algorithmic problem. The question: given a 0.1 yuan minimum fee per withdrawal (waived if balance is insufficient), how many operations are needed to transfer all money to WeChat as fees? Initial Experiments First, I verified the fee structure. Withdrawing 0.1 yuan i ...

Posted on Mon, 14 Sep 2026 16:45:56 +0000 by tomdchi

Creating Dates with a Specified Year and Month in Java

Creating Dates with a Specified Year and Month in Java Standard Implemantation Workflow Step ID Task Description 1 Inittialize a typed year-month reference using the modern Java time API 2 Attach a valid day to the reference to produce a complete calendar date 3 Extract and output date metadata from the finalized date object 1. In ...

Posted on Mon, 14 Sep 2026 16:39:17 +0000 by kerching

Building a Concurrent Web Scraper in Java

The following implementation demonstrates a multithreaded web scraper designed to extract sequential content from a target website. It utilizes a producer-consumer pattern where a central context manager handles the state of visited and pending URLs, while a thread pool of workers processes the downloading and parsing logic. Context Manager Th ...

Posted on Mon, 14 Sep 2026 16:32:53 +0000 by snowrhythm

Implementing CRUD Operations with MyBatis

Building upon foundational MyBatis knowledge, this guide demonstrates how to implement Create, Read, Update, and Delete (CRUD) operations using MyBatis with a clean and maintainable structure. The implementation requires updates to three core components: the DAO enterface, its corresponding XML mapper, and test cases. All CRUD methods are conso ...

Posted on Mon, 14 Sep 2026 16:28:30 +0000 by andycole

Understanding Java ArrayList Implementation

The ArrayList class is one of the most frequently used data structures in Java. This analysis is based on the source code version 1.8.0_261. 1.1 Key Characteristics Dynamic array implementation Threead-unsafe Maintains insertion order Fast random access, slower insertions and deletions Allows null values and duplicates 1.2 Interface Implement ...

Posted on Mon, 14 Sep 2026 16:25:11 +0000 by Ima2003

Java Programming Fundamentals: From Basics to Practical Applications

Introduction to Java Java is a versatile, object-oriented programming language that runs on the Java Virtual Machine (JVM). One of Java's core strengths is its "write once, run anywhere" capability, meaning compiled Java code can execute on any platform with a JVM installed. Command Line Basics Understanding the command line interface ...

Posted on Mon, 14 Sep 2026 16:20:05 +0000 by jackson4me90

Passing Collection Parameters in Java HTTP GET Requests

In Java, two common methods exist for passing collection parameters via HTTP GET requests: URL parameter concatenation and using the @RequestParam annotation. Each approach serves different scenraios. URL Paramter Concatenation This method converts collections into comma-separated strings appended to URLs. Suitable for simple data structures. / ...

Posted on Mon, 14 Sep 2026 16:15:06 +0000 by bishnu.bhatta

Essential CentOS Server Configuration

Installing Java 8 ========= Checking available Java versions yum search java | grep jdk Select Java 8 from the available options. Installing Java 8 yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel After installation, note the complete Java 8 version name displayed in the output, as it will be needed for environment variable configu ...

Posted on Sun, 13 Sep 2026 16:39:22 +0000 by emdee