-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFClass.java
45 lines (41 loc) · 1016 Bytes
/
FClass.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.*;
class Point{
private int x, y;
public Point(int x1, int y1)
{
x=x1;
y=y1;
}
public String toString()
{
return("("+x+","+y+")");
}
public boolean equals(Object obj)
{
if(x!=((Point)obj).x)
{
return false;
}
if(y!=((Point)obj).y)
{
return false;
}
return true;
}
}
public class FClass{
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int x1 = sc.nextInt();
int y1 = sc.nextInt();
int x2 = sc.nextInt();
int y2 = sc.nextInt();
Point p1 = new Point(x1, y1);
Point p2 = new Point(x2, y2);
if(p1.equals(p2))
System.out.println(p1 + "==" + p2);
else
System.out.println(p1 + "!=" + p2);
}
}
}