Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Lecture 1.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
704 Кб
Скачать

4.1.2. Java as a cross-platform language

Java is an interpreted language. This feature enables execution of the once compiled bytecode on all platforms without recompilation.

Java sources (files with the ".java" extension) are compiled by the Java compiler to the bytecode (files with the ".class" extension) which is interpreted by the Java Virtual Machine (JVM) installed in the operating system or being part of a web browser.

source        compilation              loading              JVM code -------------> bytecode --------------> execution (Win Unix OS/2 ...)

(.java) javac (.class)

In theory it means that once compiled, a program will execute the same way on all platforms. What a perfect idea (consider how much effort requires porting an application from one operating system to another)!

Its practical realization (in spite of many difficulties) is almost completed.

The mere portability of an interpreted language is not an extraordinary achievement. But, beside the language, its authors have created a rich set of standard libraries (API - Application Programmer Interface) which supply uniform, platform-independent means for GUI (Graphical User Interface) programming, database accessing, networking and many other activities.

The base set of libraries is called The Java Core API or JDK (Java Development Kit) or Java 2 SDK (Standard Development Kit). Furthermore, the Java Extension Framework mechanism was introduced to enable easy extension of the base set with other libraries (the standard ones as well).

4.1.3. Java as a universal environment for gui programming

The base set of standard libraries includes easy-to-use, platform-independent means for GUI programming.

Simple visual components have been available for a couple of years as a part of Java API called AWT (Abstract Window Toolkit).

As they were too modest for many advanced applications and their look was platform-dependent the new project emerged: The Swing. The main idea behind it was to enrich the look of existing components and to add some new ones as well as making the whole platform independent. Initially the Swing was a supplement to the Java 1.1 SDK but later it became a part of the J F C (Java Foundation Classes) which constitutes a substantial part of the Java 2 platform (the versions 1.2.x, 1.3 and 1.4). The JFC includes AWT together with the enhanced two-dimensional graphics (Graphics 2D), Swing, drag and drop technology and others.

4.1.4. Java as a universal environment for accessing data bases

Java SDK includes JDBC API (Java Database Connectivity API) - a set of tools for accessing (almost arbitrary) databases.

This easy-to-use facility is based on the SQL language which is a standard tool for querying databases.

4.1.5. Java as a universal multimedia programming environment

The Java Core API includes universal means for processing

  • images and graphics (2D)

  • sound and music (among others the formats WAV, AU, MIDI are supported)

Some of the currently available standard extensions

  • Java 3D for creating and processing 3-dimensional graphics,

  • Java Media Framework for processing advanced multimedia formats (RealStream among others)

are incorporated into the standard API.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]