Java WeiweiXu Learning Resources

website·Indexed 31 days ago

https://java.weiweixu.cn

A comprehensive collection of Java learning materials covering Java language basics, JVM internals (including garbage collection, runtime data areas, and bytecode analysis), concurrent programming, Spring Boot, MySQL, and IO streams.

Tokens
215.4K
Snippets
825
Records
1.3K
Agent score
47%

What's inside Java WeiweiXu

  1. Overview of Java 8 Functional Programming Features

    JDK 8 introduced several key features to support functional programming paradigms in Java:

    • Lambda Expressions: Allows concise representation of anonymous functions for flexible collection and stream processing.
    • Stream API: Provides a declarative way to process collections via pipeline operations (transform, filter, aggregate) without modifying the original data.
    • Default and Static Methods in Interfaces: Allows interfaces to have implementations, maintaining backward compatibility when adding new methods.
    • Optional Class: A container object used to handle null values more elegantly and prevent NullPointerException.
    • New Date-Time API: Includes ZoneId, Instant, DateTimeFormatter, and LocalDateTime.
    • Method References: A shorthand for Lambda expressions that refer to existing methods.
  2. Overview of international character sets

    Different standards exist to handle various languages and regional requirements:

    • GB2312: Early simplified Chinese standard (double-byte).
    • BIG5: Traditional Chinese standard used in Taiwan (double-byte).
    • GBK: Extension of GB2312, default for Windows Simplified Chinese systems.
    • GB18030: Further extension of GBK, covering more minority languages and characters (single, double, or four-byte encoding).
    • Unicode: An international standard designed to provide a unique code for every character across all languages, enabling cross-platform and cross-language text conversion. It typically uses four bytes per character in its base definition, with various encoding forms like UTF-8, UTF-16, and UTF-32.
  3. Overview of the Java Class Lifecycle stages

    The class lifecycle describes the entire process of a class being loaded, used, and unloaded by the JVM. It consists of five primary stages:

    1. Loading: The class bytecode or definition is read into memory. This typically occurs when the class is first referenced.
    2. Linking: Consists of three sub-steps: Verification (checking structural integrity), Preparation (allocating memory for static variables), and Resolution (resolving symbolic references).
    3. Initialization: Execution of static initialization code, such as assigning values to static variables and executing static blocks. This ensures the class is in a correct state before first use.
    4. Using: The class is instantiated to create objects or its static members are accessed directly.
    5. Unloading: The garbage collector may unload the class and release memory when the class is no longer referenced and specific conditions are met.
  4. Overview of the Java Class Lifecycle stages

    The lifecycle of a Java class describes the entire process from when a class is loaded, used, and eventually unloaded. It consists of five primary stages:

    1. Loading: The class bytecode or definition is read into memory. This typically occurs when the class is first referenced.
    2. Linking: This involves three sub-steps: Verification (checking structural integrity), Preparation (allocating memory for static variables), and Resolution (resolving symbolic references).
    3. Initialization: Execution of static initialization code, such as assigning values to static variables and executing static blocks.
    4. Using: The class is instantiated to create objects or its static members are accessed directly.
    5. Unloading: When a class is no longer referenced and meets specific conditions, the garbage collector may unload the class to release memory.
  5. Overview of Java Collection Framework Architecture

    Java collections are containers used to store multiple data objects. Unlike arrays, which have a fixed length and can store both primitives and objects, collections have a variable length and store only objects. Primitive types are handled via autoboxing (converting primitives to their corresponding wrapper classes) when added to a collection.

    Collections are divided into two main categories:

    1. Collection (Single-column): Stores individual elements (e.g., List, Set).
    2. Map (Double-column): Stores key-value pairs.
  6. Overview of mise development environment manager

    mise is a high-performance development environment manager written in Rust. It serves as a unified CLI that replaces multiple language-specific version managers (like nvm, pyenv, sdkman) and environment tools. It provides three core functionalities:

    1. Dev Tools Version Management: Manages hundreds of development tools through a single interface.
    2. Environment Management: Built-in environment variable management with directory-scoped configuration (similar to direnv).
    3. Task Running: A unified task system for building, testing, and deploying with dependency management and parallel execution.
  7. Overview of specialized and historical JVMs

    Various JVMs have been developed for specific use cases or platforms:

    • JRockit VM: Focused on server-side applications; lacks an interpreter and relies entirely on JIT compilation for maximum speed. Now integrated into HotSpot (since JDK 8).
    • J9 VM (IBM/OpenJ9): A high-performance VM used in IBM products, now available as the open-source Eclipse OpenJ9.
    • Azul VM: A specialized VM optimized for the Azul Vega hardware system, capable of managing massive CPU and memory resources with controlled GC times. Its software-only version is called Zing JVM.
    • Sun Classic VM: The first commercial JVM (Java 1.0); used only an interpreter and was deprecated by JDK 1.4.
    • Exact VM: Introduced in JDK 1.2 to provide accurate memory management and mixed interpreter/compiler modes.
  8. Overview of Java Virtual Machine (JVM) Components

    The JVM consists of four primary components that manage the execution of Java programs:

    1. Class Loading Subsystem: Centered around the ClassLoader, it loads bytecode files from disk or network into memory.
    2. Runtime Data Areas: Memory managed by the JVM, including the Stack, Heap, and Method Area, used to store objects and class information.
    3. Execution Engine: Converts bytecode into machine code and manages memory. It includes:
      • Interpreter: Translates bytecode instructions into machine code.
      • Just-In-Time (JIT) Compiler: Optimizes "hot spot" code to improve performance.
      • Garbage Collector (GC): Reclaims memory from unused objects.
    4. Native Interface: Allows Java to call compiled C/C++ methods, denoted by the native keyword in Java.
  9. Overview of other high-performance JVM implementations

    Several other JVMs target specific use cases:

    • JRockit VM: Focused on server-side applications; lacks an interpreter and relies entirely on JIT compilation for maximum speed. Integrated into HotSpot starting around JDK 8.
    • J9 VM (OpenJ9): IBM's multi-purpose VM for server, desktop, and embedded systems. Now managed by the Eclipse Foundation as OpenJ9.
    • Azul VM (Zing): Originally tied to proprietary Vega hardware for massive memory management and controlled GC times; Zing JVM brings these features to generic x86 platforms.
  10. Overview of Java Data Types

    Java categorizes data types into two main groups:

    1. Primitive Data Types: Consists of 4 categories and 8 specific types:
      • Integer types: byte, short, int, long
      • Floating-point types: float, double
      • Character type: char
      • Boolean type: boolean
    2. Reference Data Types: Includes classes, arrays, interfaces, enums, and annotations.
  11. Overview of Java Collection Framework

    Java collections are containers used to store multiple objects. Unlike arrays, which have a fixed length and can store both primitive types and objects, collections have a variable length and can only store objects. To support primitive types, Java uses autoboxing and unboxing to automatically convert primitives to their corresponding wrapper classes before storage.
  12. Overview of Java Functional Programming Features (JDK 8+)

    JDK 8 introduced several key features to support functional programming paradigms in Java:

    • Lambda Expressions: Allow concise representation of anonymous functions for flexible collection and stream processing.
    • Stream API: Provides a declarative way to process collections via pipelines (transformation, filtering, aggregation) without mutating the original data.
    • Default and Static Methods in Interfaces: Allow interfaces to provide implementations without breaking compatibility with existing implementing classes.
    • Optional Class: A container used to handle null values more elegantly and prevent NullPointerException.
    • New Date-Time API: Includes ZoneId, Instant, DateTimeFormatter, and LocalDateTime.
    • Method References: A shorthand for Lambda expressions that refer to existing methods.