Construtores da classe Point

A classe java.awt.Point tem dois campos, x e y, do tipo int. Essa classe oferece um construtor que permite criar um ponto representando as coordenadas do ponto, passadas como argumentos para o construtor:
public Point(int x, int y)
	
Constructs and initializes a point at the specified (xy) location in the coordinate space.
Parameters:
x - the x coordinate.
y - the y coordinate.

Há também outro construtor que recebe como argumento um outro objeto da classe Point:
public Point(Point p)
	
Constructs and initializes a point with the same location as the specified Point object.
Parameters:
p - a point.
Since:
JDK1.1

Há também um construtor default,
public Point()
Constructs and initializes a point at the origin (0, 0) of the coordinate space.
Since:
JDK1.1


© Ivan Luiz Marques Ricarte
DCA/FEEC/UNICAMP

Last modified: Wed Jun 28 14:43:54 EST 2000