title: Get String from classes node cannot find symbol
body: <p>I'm trying to get from Node of class String but the compiler cannot find the Variable. I would appreciate your help.</p>
  
  <p>Student class:</p>
  
  <pre><code>public class Students {
  
      private int[] marks;
      private String name;
  
      public Students(String name, int[] marks) {
          this.name = name;
          marks = new int[5];
          for (int i = 0; i &lt; marks.length; i++) {
              this.marks[i] = marks[i];
          }
      }
      public int getMarksI(int i) {
          return marks[0];
      }
      public int[] getMarks() {
          return marks;
      }
      public String getName() {
          return name;
      }
  }
  </code></pre>
  
  <p>The function where the problem:</p>
  
  <pre><code>public double AverageByName(Node &lt; Students &gt; s, String name) {
      Node &lt; Students &gt; p = s;
      while (p != null) {
          if (name == p.getName()) // this is the problem "cannot find symbol p.getName"
          {
              //
          }
          p.setNext();
      }
      return false;
  }
  </code></pre>
  
  <p>In addition to that there is a class of Node and the linked list of the Students class created without a problem in the main.</p>