Is there any way to find out if a LineString intersects itself in JTS? Like in the following image how can i find if the line intersects itself? I am creating that line by just giving coordinates of its 4 edges.
Thanks in advance.
No line can intersect itself. You don't have "a line"; you have four lines. You want to see if two of them intersect each other.
You can either calculate the intersection explicitly or look at how the coordinates are labeled. If you start in the lower right and number the points as A, B, C, and D by going counterclockwise, you can see that you have an intersection if there are lines connect AC and BD. If they connect AB, BC, CD, and DA there's no intersection possible except at the common points.