PDA

View Full Version : What is Instance, Empty Constructor ....



tking88
10-23-2009, 01:40 PM
K I did something like this and all ok now it return the true compare value



public boolean equals(Object o)
{
System.out.println(o instanceof Moof);
System.out.println(((Moof)o).getMoofValue());
System.out.println(this.moofValue); //XXX
if ((o instanceof Moof) && (((Moof)o).getMoofValue() == this.moofValue))
{
return true;
}
else
{
return false;
}