Java Swing Tutorial - Java BasicStroke.equals(Object obj)








Syntax

BasicStroke.equals(Object obj) has the following syntax.

public boolean equals(Object obj)

Example

In the following code shows how to use BasicStroke.equals(Object obj) method.

import java.awt.BasicStroke;

public class Main {
  public static void main(String[] args) {
    BasicStroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.1F);
    System.out.println(stroke.equals(stroke));

  }
}

The code above generates the following result.