title: If return type is static does the method has to be static
body: <p>I was studying Singleton and I came across the following code block</p>
  
  <pre><code>public class School {
  private static School school;
  private ArrayList&lt;String&gt; teachers;
  private School(){
      teachers = new ArrayList&lt;&gt;();
      teachers.add("adam");
      teachers.add("john");
      teachers.add("jackson");
      teachers.add("jason");
  }
  public static School getInstance(){
      if (school==null)
          school=new School();
      return school;
  }
  public String getTeacher(){
      if (!(teachers.size() ==0))
          return teachers.remove(0);
      return "no teachers left";
  }
  </code></pre>
  
  <p>}</p>
  
  <p>As you can see the getInstance() method is static. I was wandering why?</p>
  
  <p>Thanks in advance for your help :)</p>
  
  <p>I know the return type is not static literally. The return type here is School. In Singleton, there has to be one instance of it using a static variable of the class it self, I get that part and make perfect sense. But my question was, why the method that sets the static variable has to be Static as well? That is the question. </p>