Java教程
  • Introduction
  • Getting Started
    • The Java Technology Phenomenon
      • About the Java Technology
      • What Can Java Technology Do?
      • How Will Java Technology Change My Life?
    • The Hello World Application
    • A Closer Look at the Hello World Application
  • Learning the Java Language
    • Object-Oriented Programming Concepts
      • What Is an Object?
      • What Is a Class?
      • What Is Inheritance?
      • What Is an Interface?
      • What Is a package?
    • Language Basics
      • Java Language Keywords
    • Annotations
      • Annotations Basics
      • Declaring an Annotation Type
      • Predefined Annotation Types
      • Repeating Annotations
      • Type Annotations and Pluggable Type Systems
    • Generics
      • Why Use Generics?
      • Generic Types
        • Raw Types
      • Generic Methods
      • Bounded Type Parameters
        • Generic Methods and Bounded Type Parameters
      • Generics, Inheritance, and Subtypes
      • Type Inference
      • Wildcards
        • Upper Bounded Wildcards
        • Unbounded Wildcards
        • Lower Bounded Wildcards
        • Wildcards and Subtyping
        • Wildcard Capture and Helper Methods
        • Guidelines for Wildcard Use
      • Type Erasure
        • Erasure of Generic Types
        • Erasure of Generic Methods
        • Effects of Type Erasure and Bridge Methods
        • Non-Reifiable Types
      • Restrictions on Generics
Powered by GitBook
On this page
  • Java语言
  • Java平台

Was this helpful?

  1. Getting Started
  2. The Java Technology Phenomenon

About the Java Technology

PreviousThe Java Technology PhenomenonNextWhat Can Java Technology Do?

Last updated 5 years ago

Was this helpful?

Java技术既是一种编程语言也是一个平台

Java语言

Java语言是一个高级语言,可以用如下这些时髦词语来描述它:

  • 简单

  • 面向对象

  • 分布式

  • 多线程

  • 动态

  • 架构独立

  • 可移植

  • 高性能

  • 鲁棒性

  • 安全

James Gosling和Henry McGilto的文章中对这些词进行了解释

在Java语言中,所有的源代码以.java扩展名结尾的纯文本文件编写。接下来使用java compiler将原文件编译为.class文件。.class文件并不包含处理器可以直接使用的代码,而是Java Virtual Machine(JVM)使用的机器语言被称之为bytecodes。Java启动工具通过一个JVM实例运行你的程序。

An overview of the software development process.

Java平台

Platform(平台)指的是一个程序运行的软硬件环境。我们已经提到过一些著名的平台比如Microsoft Windows,Linux,Solaris OS,Mac OS。大多数平台都可以描述成操作系统和底层硬件的混合体。Java平台不同于其他的平台因为它只是在其他基于硬件的平台之上的一个软件平台。

Java平台包含两个组件:

  • Java Virtual Machine

  • Java Application Programming Interface (API)

上文已经介绍过Java Virtual Machine,它是Java平台的基础并且被移植到许多不同的硬件平台。

API是一个现成的供许多有用功能的软件组件集合,它由许多关联的类和接口组成不同的libraries,这些libraries一般称之为包。下一章会介绍API的一些功能。

作为一个平台无关的环境,Java平台可能比native code(机器码)慢一些。但是编译器与虚拟机技术的进步使得性能接近于native code,同时不会影响到可移植性。

Java Virtual Machine和JVM都指的是Java平台的虚拟机。

由于JVM可以运行在不同的操作系统之上,所以.class文件就有能力在Microsoft Windows,the Solaris™ Operating System (Solaris OS),Linux,Mac OS系统中运行。有些虚拟机比如,会在运行时进行额外的任务来提升程序的性能,包括发现程序的性能瓶颈和将经常运行的代码片段重新编译成native code。

Through the Java VM, the same application is capable of running on multiple platforms.
The API and Java Virtual Machine insulate the program from the underlying hardware.
Java SE HotSpot at a Glance
The Java Language Environment