class Point {

int x;

int y;

Point(int X, int Y) { x = X; y = Y;}

}

public class Solution {

```
private boolean checkThree(Point point1, Point point2, Point point3){
int dx1 = point2.x - point1.x;
int dy1 = point2.y - point1.y;
int dx2 = point3.x - point1.x;
int dy2 = point3.y - point1.y;
return dx1*dy2 == dx2*dy1;
}
public int maxPoints(Point[] points) {
if(points.length <= 2) return points.length;
int count = 0;
int max_count = count;
for(int i = 0; i < points.length; i++){
for (int j = i + 1; j < points.length; j++){
for (int k = 0; k < points.length; k++){
if(checkThree(points[i], points[j], points[k])) count++;
}
if(count > max_count) max_count = count;
count = 0;
}
}
return max_count;
}
```

}