Print the elements of a tree in level order

I am working on a method that prints the elements of a tree in level order and that prints "None" if the queue is empty. I have looked up some examples online and think I am on the right track but I don't really know where to go from here. So far i created the queue and made the root the head of the queue. It has no compiler errors as is but when try to break it down in my head I am just getting a bit lost. I also added the StudentGrade and TreeNode classes so you can get an idea. Is what I have on the right track? If anyone sees anything wrong or could input me on what I need to do it would be greatly appreciated!

public void printLevelOrder(){
  Queue<TreeNode<StudentGrade>> queue = new LinkedList<TreeNode<StudentGrade>>();
  if (queue.isEmpty())
  while (!queue.isEmpty()){
     root = queue.poll();
     if (root.right != null)
     if (root.left != null)



StudentGrade class:

public class StudentGrade implements Comparable<StudentGrade> {
   private String name;
   private double grade;

   public StudentGrade(String n, double g){
      name = n;
      grade = g;

   public int compareTo(StudentGrade other){
      if (this.getName().compareTo(other.getName()) > 0)
         return 1;
      else if (this.getName().compareTo(other.getName()) < 0)
         return -1;
         return 0;

   public double getGrade(){
      return grade;

   public String getName(){
      return name;

   public String toString(){
      return name + " " + Double.toString(grade);

TreeNode class:

protected static class TreeNode<E extends Comparable<E>> {
  protected E element;
  protected TreeNode<E> left;
  protected TreeNode<E> right;

  public TreeNode(E e) {
      element = e;