Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Тема 3. Документация Java API. Создание и испол...doc
Скачиваний:
2
Добавлен:
01.05.2025
Размер:
180.74 Кб
Скачать

Программирование на Java (4 курс) 9 / 9

Тема 3. Документация Java api. Создание и использование объектов

Тема 3. Документация Java api

  1. Загрузка и установка Java

Официальным разработчиком языка Java является фирма Sun Microsystems (официальный сайт http://java.sun.com).

Для того чтобы программировать на языке Java, необходимо установить на свой компьютер:

  1. Компилятор;

  2. оболочку времени выполнения (Java Runtime Environment, JRE) – это окружение, в котором работает Java-программа (т.к. Java-программы работают на виртуальной машине).

Эти компоненты входят в состав комплекта разработчика Java (Java Developers Kit, JDK) - пакета программ, который бесплатно распространяется фирмой Sun Microsystems.

Java находится в Интернете по адресу:

http://java.sun.com/javase/downloads/index.jsp

Можно изучить сайт компании Sun в поисках допол­нительной информации, такой как документация к языку или обучающие программы.

Оболочки для программирования на Java третьих фирм

Многие фирмы - поставщики программного обеспечения (в частности, Borland, Microsof и Symantec) разрабатывают свои оболочки для программирования на Java. В состав этих оболочек включен графический интерфейс пользователя, который делает их более удобными в использовании в сравнении с JDK. Однако все эти продукты уже не являются бесплатными.

Оболочки для программирования на Java:

NetBeans – графическая оболочка от фирмы Sun Microsystems (свободно распространяемая);

VisualJ – графическая оболочка от фирмы MicroSoft;

JBuilder – графическая оболочка от фирмы Borland и др.

Мы работаем с JDK 1.5 (Java 5) и NetBeans.

Платформы Java:

Java SE – стандартная;

Java ЕE – для Internet и компьютерных сетей;

Java МE – для мобильных устройств.

  1. Документация Java api

Полную документацию Java API (Java Application Programming Interface) можно найти в Ин­тернете по адресу:

http://java.sun.eom/j2se/l.5.0/docs/api/.

Это лучший доступный справочник в тех ситуациях, когда у вас есть вопросы по программированию на языке Java.

JDKTM 5.0 Documentation

Download this Documentation

Search   General Info   API & Language   Guide to Features   Tool Docs   Demos/Tutorials

J2SETM Platform at a Glance

This document covers the JavaTM 2 Platform Standard Edition 5.0 Development Kit (JDK 5.0). Its external version number is 5.0 and internal version number is 1.5.0. For information on a feature of the JDK, click on its component in the diagram below.

Search the Documentation

Location    

Search the online documentation

website

New to the Java Platform?

See the New-to-JavaTM Programming Center.

website

General Information

Readme, Overview, Changes

README

website

New Features and Enhancements

docs

Release Notes

website

 

Installation Instructions

Installation Notes System Configurations

website

 

Compatibility

Version Compatibility with Previous Releases

website

 

Bugs

Fixed and Known Bugs

website

Submitting a Bug Report

website

 

Contacts

Contacting Java Software

docs

 

Releases and Downloads

JDK Download Page

website

Java Software Home Page

website

 

Legal Notices

Documentation Redistribution Policy

website

Copyright and License Terms for Documentation

docs

API & Language Documentation

Java 2 Platform API Specification   (NO FRAMES)

docs

 

Note About sun.* Packages

website

 

The Java Language Specification   (DOWNLOAD)

website

 

The Java Virtual Machine Specification   (DOWNLOAD)

website

Все классы сгруппированы в ПАКЕТЫ (аналог стандартных библиотек). Рассмотрим структуру информации о классе на примере класса Point (java.awt.Point).

java.awt Class Point

java.lang.Object

java.awt.geom.Point2D

java.awt.Point

All Implemented Interfaces:

Serializable, Cloneable

public class Point

extends Point2D

implements Serializable

A point representing a location in (x, y) coordinate space, specified in integer precision.

Since:

JDK1.0

See Also:

Serialized Form

Nested Class Summary

 

Nested classes/interfaces inherited from class java.awt.geom.Point2D

Point2D.Double, Point2D.Float

 

Field Summary

 int

x           The x coordinate.

 int

y           The y coordinate.

 

Constructor Summary

Point()           Constructs and initializes a point at the origin (0, 0) of the coordinate space.

Point(int x, int y)           Constructs and initializes a point at the specified (xy) location in the coordinate space.

Point(Point p)           Constructs and initializes a point with the same location as the specified Point object.

 

Method Summary

 boolean

equals(Object obj)           Determines whether or not two points are equal.

 Point

getLocation()           Returns the location of this point.

 double

getX()           Returns the X coordinate of the point in double precision.

 double

getY()           Returns the Y coordinate of the point in double precision.

 void

move(int x, int y)           Moves this point to the specified location in the (xy) coordinate plane.

 void

setLocation(double x, double y)           Sets the location of this point to the specified double coordinates.

 void

setLocation(int x, int y)           Changes the point to have the specified location.

 void

setLocation(Point p)           Sets the location of the point to the specified location.

 String

toString()           Returns a string representation of this point and its location in the (xy) coordinate space.

 void

translate(int dx, int dy)           Translates this point, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy).