Class Point


  • public class Point
    extends Object
    Represents an ordered pair of x and y coordinates that define a point in a two-dimensional plane.
    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(double x, double y)
      Initializes a new instance of the Point class with the specified coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object obj)
      Determines whether the specified object is equal to the current Point.
      double getX()
      Gets the x-coordinate of this Point.
      double getY()
      Gets the y-coordinate of this Point.
      int hashCode()
      Returns the hash code for this Point.
      String toString()
      Returns a string that represents the current Point.
      • Methods inherited from class Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Point

        public Point​(double x,
                     double y)
        Initializes a new instance of the Point class with the specified coordinates.
        Parameters:
        x - The x-coordinate of the point.
        y - The y-coordinate of the point.
    • Method Detail

      • getX

        public double getX()
        Gets the x-coordinate of this Point.
        Returns:
        The x-coordinate.
      • getY

        public double getY()
        Gets the y-coordinate of this Point.
        Returns:
        The y-coordinate.
      • equals

        public boolean equals​(Object obj)
        Determines whether the specified object is equal to the current Point.
        Overrides:
        equals in class Object
        Parameters:
        obj - The object to compare with the current Point.
        Returns:
        true if the specified object is equal to the current Point; otherwise, false.
      • hashCode

        public int hashCode()
        Returns the hash code for this Point.
        Overrides:
        hashCode in class Object
        Returns:
        A hash code for the current Point.
      • toString

        public String toString()
        Returns a string that represents the current Point.
        Overrides:
        toString in class Object
        Returns:
        A string that represents the current Point.