class Person extends Object
{
	private String name;
	private String vorname;
	private static int count;
		
	Person(String name,String vorname)
	{
		super();
		this.name=name;
		this.vorname=vorname;
		count++;		
	}
	public void setName(String name)
	{
		this.name=name;
	}
	public void setVorname(String vorname)
	{
		this.vorname=vorname;
	}
	public String getName()
	{
		return name;
	}
	public String getVorname()
	{
		return vorname;
	}	
	public static int getCount()
	{
		return count;
	}	
	//Version 1, Langform
//	public boolean equals(Object obj)
//	{
//		 Person a=null;
//		 
//		 if (obj instanceof Person)
//		 	a=(Person)obj;
//		 else
//		 	return false;
//		 if (this.name.equals(a.name)&&
//		 		this.vorname.equals(a.vorname))	
//		 	return true;
//		 else
//		 	return false;	
//	}
	//Version 2, Kurzform
	public boolean equals(Object obj)
	{
		if (obj instanceof Person)
			return (this.name.equals(((Person)obj).name)&&
		 		this.vorname.equals(((Person)obj).vorname));
		return super.equals(obj);
	}
	public String toString()
	{
		return ("Name: "+this.name+"; Vorname: "+this.vorname);
	}	
	
}			