📊 Capítulo 01: Ecossistema Java 21 LTS & JVM
Especialização em Sistemas com Java
🗺️ O Pipeline de Execução da Java Virtual Machine (JVM)
flowchart TD
SRC["Código Fonte Java (.java)"]
--> JAVAC["Compilador javac (Compilação Estática para Bytecode)"]
--> BYTECODE["Bytecode Portável (.class)"]
BYTECODE --> CLASSLOADER["JVM ClassLoader (Carregamento, Linkagem, Inicialização)"]
CLASSLOADER --> EXEC_ENGINE["Execution Engine"]
EXEC_ENGINE --> INTERPRETER["Interpretador (Execução imediata instrução a instrução)"]
EXEC_ENGINE --> JIT["JIT Compiler - C1 / C2 (Compila Hotspots em Código de Máquina Nativo!) ⚡"]
EXEC_ENGINE --> GC["Garbage Collector (ZGC Geracional / G1 GC / Shenandoah)"]
JIT --> CPU["Execução em CPU x86_64 / ARM64 com Zero Overhead!"]
style SRC fill:#ede7f6,stroke:#512da8,stroke-width:2px
style JAVAC fill:#fff3e0,stroke:#ff9800,stroke-width:1.5px
style BYTECODE fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px
style CLASSLOADER fill:#fff9c4,stroke:#fbc02d,stroke-width:1.5px
style EXEC_ENGINE fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
style INTERPRETER fill:#b2dfdb,stroke:#00796b,stroke-width:1.5px
style JIT fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px
style GC fill:#ffebee,stroke:#d32f2f,stroke-width:1.5px
style CPU fill:#00897b,stroke:#004d40,stroke-width:2px,color:#ffffff
🎯 Slide 1: Java 21 LTS: A Era de Ouro do Java Moderno
-
Suporte a Longo Prazo (LTS): Estabilidade e performance para a próxima década.
- Grandes Revoluções:
- Projeto Loom: Virtual Threads nativas de altíssima escala.
- Projeto Amber: Pattern Matching para
switch, Records e Sealed Classes. - Projeto Panama: Foreign Function & Memory API (FFM) substituindo o arcaico JNI!
🎯 Slide 2: Tipos Primitivos vs Tipos Referência
-
Primitivos (Stack / Alocados na Pilha):
byte,short,int,long,float,double,boolean,char(alta performance, zero alocação de heap). - Referência (Heap / Ponteiros Gerenciados pelo GC): Objetos, Strings e Arrays.
🎯 Slide 3: Estrutura Sequencial e Entrada com Scanner
import java.util.Scanner;
import java.util.Locale;
public class Main {
public static void main(String[] args) {
Locale.setDefault(Locale.US);
try (Scanner sc = new Scanner(System.in)) {
double raio = sc.nextDouble();
double area = Math.PI * Math.pow(raio, 2.0);
System.out.printf("A=%.4f%n", area);
}
}
}
🔗 Navegação do Capítulo 01
| 📖 Ler Conteúdo Completo | 🧠 Fazer Quiz | 💻 Ver Exemplos | 🧩 Exercícios |
Slide 1 de 1
Atalhos: ← → Navegar • Espaço Avançar • F Tela Cheia • Home Início • End Fim