**Inheritance:**
java.lang.Object, [com.aspose.imaging.ShapeSegment](../../com.aspose.imaging/shapesegment)
```
public class LineSegment extends ShapeSegment
```

Represents a segment leading directly from a specific point to the next point.
## Constructors

| Constructor | Description |
| --- | --- |
| [LineSegment(PointF startPoint, PointF endPoint)](#LineSegment-com.aspose.imaging.PointF-com.aspose.imaging.PointF-) | Initializes a new instance of the `LineSegment` class. |
## Methods

| Method | Description |
| --- | --- |
| [getStartPoint()](#getStartPoint--) | Gets the starting point. |
| [getEndPoint()](#getEndPoint--) | Gets the ending point. |
| [equals(Object o)](#equals-java.lang.Object-) | Check if objects are equal. |
| [hashCode()](#hashCode--) | Get hash code of the current object. |
### LineSegment(PointF startPoint, PointF endPoint) {#LineSegment-com.aspose.imaging.PointF-com.aspose.imaging.PointF-}
```
public LineSegment(PointF startPoint, PointF endPoint)
```


Initializes a new instance of the `LineSegment` class.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| startPoint | [PointF](../../com.aspose.imaging/pointf) | The start point. |
| endPoint | [PointF](../../com.aspose.imaging/pointf) | The end point. |

### getStartPoint() {#getStartPoint--}
```
public PointF getStartPoint()
```


Gets the starting point.

Value: The starting point.

**Returns:**
[PointF](../../com.aspose.imaging/pointf)
### getEndPoint() {#getEndPoint--}
```
public PointF getEndPoint()
```


Gets the ending point.

Value: The ending point.

**Returns:**
[PointF](../../com.aspose.imaging/pointf)
### equals(Object o) {#equals-java.lang.Object-}
```
public boolean equals(Object o)
```


Check if objects are equal.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | The other object. |

**Returns:**
boolean - The equality comparison result.
### hashCode() {#hashCode--}
```
public int hashCode()
```


Get hash code of the current object.

**Returns:**
int - The hash code.
