About the Java Technology
Java technology is both a programming language and a platform.
The Java Programming Language
The Java programming language is a high-level(高级) language that can be characterized by(以…为特点) all of the following buzzwords(流行语):
- 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.
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.
An overview of(概况) the software development process.
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(部分代码).
Through the Java VM, the same application is capable of(有…能力) running on multiple platforms.
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.
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.
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.