Point

Inheritance: java.lang.Object

public class Point

Represents a point.

Constructors

Constructor Description
Point(double x, double y) Initializes a new instance of the Point class.

Methods

Method Description
getX() Gets the x-coordinate.
getY() Gets the y-coordinate.
parse(String s) Converts the string representation of a point to its class equivalent.
toString()

Point(double x, double y)

public Point(double x, double y)

Initializes a new instance of the Point class.

Parameters:

Parameter Type Description
x double The x-coordinate.
y double The y-coordinate.

getX()

public double getX()

Gets the x-coordinate.

Returns: double - A double value that represents the x-coordinate.

getY()

public double getY()

Gets the y-coordinate.

Returns: double - A double value that represents the y-coordinate.

parse(String s)

public static Point parse(String s)

Converts the string representation of a point to its class equivalent. A return value indicates whether the conversion is succeeded or failed.

Parameters:

Parameter Type Description
s java.lang.String A string containing a point to convert.

Returns: Point - The instance of Point class that is equivalent to the value specified in s parameter.

toString()

public String toString()

Returns: java.lang.String