Java 简介

Java 的主要特性、发展历史与常见开发工具。

Beginner
Key PointsJava 是静态类型、面向对象、跨平台的编译型语言;源码编译为字节码,由 JVM 执行,因此「一次编写,到处运行」。

主要特性

Java targets simple, object-oriented, portable, robust and secure code. It resembles C++ but drops pointers and multiple inheritance, manages memory with garbage collection, and hides platform differences behind the JVM.

  • Platform independent — bytecode runs on any JVM
  • Object-oriented — everything lives in a class
  • Automatic memory management — GC reclaims objects
  • Statically typed — types checked at compile time
  • Multithreaded — built-in thread and lock support
  • Strong ecosystem — Spring, Maven, huge library base

发展历史

Java was released in 1995 by James Gosling's team at Sun Microsystems, originally named Oak for embedded devices before pivoting to the web. Oracle acquired Sun in 2010 and now leads its evolution.

VersionYearHighlights
JDK 1.01996First release
Java 52004Generics, annotations, enum, for-each
Java 82014Lambda, Stream, new Date API
Java 112018LTS, var, HttpClient
Java 172021LTS, records, sealed classes
Java 212023LTS, virtual threads, pattern matching

Java 开发工具

IntelliJ IDEA (free Community edition) is the usual editor, with Eclipse and VS Code + Extension Pack for Java as alternatives. Build with Maven or Gradle, and test with JUnit 5.

  • IntelliJ IDEA — best refactoring and debugging
  • Eclipse — long-standing, plugin-rich IDE
  • Maven / Gradle — dependency and build management
  • JUnit 5 — the standard testing framework

Friends & Partners