import java.util.*;
public class Point {
   // generally public attributes should be avoided
	// but this matches the Java Point class
   public int x;
	public int y;
	public Point(int x, int y) {
	   this.x = x;
		this.y = y;
	}
	/**
	 * determine if two points have same coordinates
	 * @return true if same x,y
	 */
	@Override 
	public boolean equals(Object other) {
	   if (other instanceof Point) {
	      Point p2 = (Point) other;
	      return (this.x == p2.x) &&
	         (this.y == p2.y);
	   }
	   else {
	      return false;
	   }
	}
	
	public static void main(String[] args) {
		int x,y;
		x = 6;
		y = 6;
		if (x==y) {
		   System.out.println("x==y");
		}   // TRUE

      Point p1, p2;
      p1 = new Point(3,4);
		p2 = new Point(3,4);
		if (p1==p2) {
		}
		else {
		   System.out.println("p1 and p2 aren't ==");
		}  // FALSE
		
		System.out.println("p1.equals(p2) is " + p1.equals(p2));

		Scanner scan = new Scanner(System.in);
		System.out.println("type hello: ");
		String s1 = scan.next();
		if (s1=="hello") {
		}
		else {
			System.out.println("is false, obviously.");
		}  
	}
}
	