Java Swing Tutorial - Java Point.toString()








Syntax

Point.toString() has the following syntax.

public String toString()

Example

In the following code shows how to use Point.toString() method.

import java.awt.Point;


public class Main {
  public static void main(String[] args) {
    Point p = new Point();
    System.out.println(p.toString());
  }
}

The code above generates the following result.