

class Student {
	// fields are listed above the constructos

	// general form
	// access_modifiers type variable_name = initial_value;

	private String name = null;
	private String address = null;


	// constructors do not return data
	// therefore do not have return types
	// they initialize fields
	/*
	public Student() {
		System.out.println("hello");
		System.out.println(this);
	}
	*/

	public Student(String name) {
		this.name = name;	
	}

	public Student(String name, String address) {
		this.name = name;
		this.address = address;
	}

	 
	public String getName() {
		return this.name;
	}

	public String getAddress() {
		return this.address;
	}	

	public void setName(String n) {
		this.name = n;
	}

	public void setAddress( String a) {
		this.address = a;
	}

	// Overide the Object class' toString method

	public String toString() {
		return this.name + ", " + this.address;
	}

	// Override the Object class' equals method

	public boolean equals(Object obj) {

		if(!(obj instanceof Student)) {
			return false;
		}

		Student temp = (Student) obj;

		//String s1Name = this.getName();
		//return s1Name.equals(temp.getName());

		return this.address.equals(temp.getAddress());
	}
}
