The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
Java technology is both a programming language and a platform.Java技术既是一种编程语言,也是一种平台。
The Java programming language is a high-level language that can be characterized by all of the following buzzwords:Java编程语言是一种高级语言,其特点是具有以下所有流行语:
|
|
Each of the preceding buzzwords is explained in The Java Language Environment , a white paper written by James Gosling and Henry McGilton.前面的每一个流行语都在《Java语言环境》中进行了解释,它是由James Gosling和Henry McGilton撰写的白皮书。
In the Java programming language, all source code is first written in plain text files ending with the 在Java编程语言中,所有源代码首先都是以.java
extension..java
扩展名结尾的纯文本文件编写的。Those source files are then compiled into 这些源文件然后由.class
files by the javac
compiler.javac
编译器编译成.class
文件。A .class
file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM)..class
文件不包含处理器本机代码;而是包含字节码—Java虚拟机1(Java VM)的机器语言。The java
launcher tool then runs your application with an instance of the Java Virtual Machine.java
启动工具然后使用Java虚拟机的实例运行应用程序。
An overview of the software development process.软件开发过程概述。
Because the Java VM is available on many different operating systems, the same 由于Java VM可在许多不同的操作系统上使用,因此相同的.class
files are capable of running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS..class
文件可以在Microsoft Windows、Solaris™操作系统(Solaris操作系统)、Linux或Mac操作系统上运行。Some virtual machines, such as the Java SE HotSpot at a Glance, perform additional steps at runtime to give your application a performance boost.一些虚拟机,譬如JavaSE热点一目了然,在运行时执行额外的步骤来提高应用程序的性能。This includes various tasks such as finding performance bottlenecks and recompiling (to native code) frequently used sections of code.这包括各种任务,如查找性能瓶颈和重新编译(到本机代码)经常使用的代码段。
Through the Java VM, the same application is capable of running on multiple platforms.通过JavaVM,同一个应用程序能够在多个平台上运行。
A platform is the hardware or software environment in which a program runs.平台是程序运行的硬件或软件环境。We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS.我们已经提到了一些最流行的平台,如Microsoft Windows、Linux、Solaris操作系统和Mac操作系统。Most platforms can be described as a combination of the operating system and underlying hardware.大多数平台可以描述为操作系统和底层硬件的组合。The Java platform differs from most other platforms in that it‘s a software-only platform that runs on top of other hardware-based platforms.Java平台与大多数其他平台的不同之处在于,它是一个只运行软件的平台,运行在其他基于硬件的平台之上。
The Java platform has two components:Java平台有两个组件:
You've already been introduced to the Java Virtual Machine; it's the base for the Java platform and is ported onto various hardware-based platforms.已经向您介绍了Java虚拟机;它是Java平台的基础,并被移植到各种基于硬件的平台上。
The API is a large collection of ready-made software components that provide many useful capabilities.API是大量现成软件组件的集合,提供了许多有用的功能。It is grouped into libraries of related classes and interfaces; these libraries are known as packages.它被分成相关类和接口的库;这些库称为包。The next section, What Can Java Technology Do? highlights some of the functionality provided by the API.下一节,Java技术可以做什么?突出显示API提供的一些功能。
The API and Java Virtual Machine insulate the program from the underlying hardware.API和Java虚拟机将程序与底层硬件隔离开来。
As a platform-independent environment, the Java platform can be a bit slower than native code.作为独立于平台的环境,Java平台可能比本机代码慢一点。However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.然而,编译器和虚拟机技术的进步正在使性能接近本机代码,而不会威胁可移植性。