You get no output because the 'if' conditions are never true.
'==' compares if the references point to the same object - i.e. the same physical spot in memory. Since your two Dog objects were both created with the 'new' operator, they are indeed different, hence that one is false.
'equals' is a method. By default, when you define a new class, you inherit the parent class' version of 'equals'. the parent class of your Dog class is Object, and Object's 'equals' method is defined as...comparing the memory addresses.
If you want your Dog class to have a meaningful equals method, you would need to override the definition with something like
public boolean equals (Dog d)
{
if (this.name.equals(d.name))
return true;
else
return false
}
Since name is a String, and the String class has the equals method overridden to something useful, it should work. Note -that is untested code, written before I really woke up this morning. it may need some tweaking.
Also, there are some additional subtleties you will need to learn at some point, but probably not right now.