I asked this earlier in chat, but what happens if I'm calling a toString method when two exist?
In the classes below, I intend on adding the following method findMin() to the BinarySearchTree class.
public void findMin()
{
Node min = root;
if(root.left != null)
min = root.left;
System.out.println("The smallest node is: " + min);
}
My question is that assuming I set root to hold object type Author by setting Node root = Author example, when the print calls min.toString(), will it be the default toString() [which returns a hashcode]? Or will it call Author.toString(), returning the toString() method defined in the Author class?
For reference, I've included the two classes below.