Print left-most and right-most elements of tree

I am trying to create a method that will print out the names of the nodes at the left-most and right-most positions of a tree. There is some context here that I should address.

In my “StudentGrade” class I have a getName() method which will certainly have to be used

public String getName(){
   return name;
}

But in terms of actually getting to those final left and right nodes, I am pretty lost. The method isn’t supposed to take any parameters so It’s not like I can take a root parameter and just keep going until the left and right are null. I was thinking something along the lines of of iteration, maybe a for loop, but i don’t really even know where to start.

Psuedo code

public void printFristAndLastNames(){
  E first = element; 
  for (TreeNode<E> node) 
     first = node.element; 
     System.out.println("First: " + first);
}