【譯】About the Java Technology

About the Java Technology

Java technology is both a programming language and a platform.html

The Java Programming Language

The Java programming language is a high-level(高級) language that can be characterized by(以…爲特色) all of the following buzzwords(流行語):java

  • Simple
  • Object oriented
  • Distributed (分佈式的)
  • Multithreaded
  • Dynamic
  • Architecture neutral(。。。)
  • Portable(便捷的)
  • High performance (高性能)
  • Robust (健壯的)
  • Secure

Each of the preceding buzzwords(前面的流行語) is explained in The Java Language Environment , a white paper written by James Gosling and Henry McGilton.oracle

In the Java programming language, all source code is first written in plain text(純文本) files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. 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). The java launcher tool(啓動程序工具) then runs your application with an instance of(一個實例) the Java Virtual Machine.app

Figure showing MyProgram.java, compiler, MyProgram.class, Java VM, and My Program running on a computer.

An overview of(概況) the software development process.jsp

Because the Java VM is available on many different operating systems, the same .class files are capable of(有能力作) running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS. Some virtual machines, such as the Java SE HotSpot at a Glance, perform(執行) additional steps at runtime to give your application a performance boost(性能提高). This includes various tasks such as finding performance bottlenecks(性能瓶頸) and recompiling (to native code) frequently used(經常使用的) sections of code(部分代碼).分佈式

Figure showing source code, compiler, and Java VM's for Win32, Solaris OS/Linux, and Mac OS

Through the Java VM, the same application is capable of(有…能力) running on multiple platforms.ide

The Java Platform

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. 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.工具

The Java platform has two components:性能

  • The Java Virtual Machine
  • The Java Application Programming Interface (API)

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.code

The API is a large collection of ready-made(現成的) software components that provide many useful capabilities(功能). 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.

Figure showing MyProgram.java, API, Java Virtual Machine, and Hardware-Based Platform

The API and Java Virtual Machine insulate(隔離) the program from the underlying hardware.

As a platform-independent(獨立於平臺) environment, the Java platform can be a bit slower(有一點慢) than native code. However, advances(進步) in compiler and virtual machine technologies are bringing performance close to(接近於) that of native code without threatening portability(危險的移植性).

The terms"Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform.

相關文章
相關標籤/搜索