title: implementing simply linked list in Java
body: <p>I am new to Java and trying to implement a simple linked list in Java(I know there is a special class for that) and having a problem in the toString() methode for the class Tour wich is not working. it's suppose to be a recursive methode. </p>
  
  <pre><code>public class Tour {
      private Ville city;
      private Tour suivant;
  
      public Ville getVille() {
          return(city);
      }
  
      public Tour getSuivant() {
          return(suivant);
      }
  
      public void setVille(Ville laVille) {
          city = laVille;
      }
  
      public void setSuivant( Tour leSuivant) {
          suivant = leSuivant;
      }
  
      public String toString(){
          if(this == null) {
              return("Fin");
          } else {
              return(city.toString()+"-&gt;" + this.suivant.toString());
          }   
      }
  }
  </code></pre>
  
  <p>the main method is here :</p>
  
  <pre><code>public class Test {
      public static void main(String[] args) {
          Ville v1 = new Ville();
          v1.setNom("tantan");
          v1.setCoordonner(1,5);
  
          Ville v2 = new Ville();
          v2.setNom("Errachidia");
          v2.setCoordonner(10,6);
  
          Tour t1 = new Tour();
          t1.setVille(v1);
          t1.setSuivant(null);
  
          Tour t2 = new Tour();
          t2.setVille(v2);
          t2.setSuivant(t1);
  
          System.out.println(t2);
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>