import java.util.Scanner;

class Nov12 {

	private static int x = 7;

	public static void main(String[] args) {

		Scanner kb = new Scanner(System.in);

		// methods accessed from static methods (e.g. main) must be static
		foo(5);		

		// fields accessed from static methods (e.g. main) must be static
		int y = x;

		Point3D p1 = new Point3D(1,1,1);
		Point3D p2 = new Point3D(1,1,1);

		System.out.println(p1.toString());
		System.out.println(p2.toString());

		// determine if p1 and p2 point to the same location in space

		// option 1
		// compare individual values in each significant field

		if (p1.getX() == p2.getX() && p1.getY() == p2.getY() && p1.getZ() == p2.getZ()) {
			System.out.println("equal");
		} else {
			System.out.println("not equal");
		}

		// option 2
		// override equals in Point3D

		if (p1.equals(p2)) {
			System.out.println("equal");
		} else {
			System.out.println("not equal");
		}
	 

	}

	// example of a recursive method (a method that invokes itself)
	public static void foo(int x) {

		if (x == 6) {
			return;
		}

		System.out.println(x);
		System.out.println(Nov12.x);

		foo(x+1);
	}
}

// end of file
