title: java: Use Constructor of another class
body: <p>I searched the Forum now for half an hour and i just dont find a solution..
  I have to write a Programm "Student" that has 2 constructors (one with parameters). Now i am trying to test it in my testclass "StudentTest2" but i just cant get to the constructor of class Student.</p>
  
  <p>My Class Student is:</p>
  
  <pre><code>import java.util.ArrayList;
  
  public class Student{
  
    boolean validMatNumber;
    String name;
    private int matrikelnummer;
    //statisch, da sich die Anzahl der Studenten global ändern muss
    static int numberOfStudents;
    static ArrayList&lt;Student&gt; students = new ArrayList&lt;Student&gt;();
  
    public Student() {
      new Student();
      students.add(this);
      numberOfStudents++;
    }
  
    public Student(String name, int matrikelnummer){
      if (matrikelnummer &gt; 9999 &amp;&amp; matrikelnummer &lt; 100000){
        validMatNumber = true;
        this.matrikelnummer = matrikelnummer;
        this.name = name;
        students.add(this);
        numberOfStudents++;  
      }
      else{
        validMatNumber = false;
      }
    }
  
    String printInformation(){
      return ("Name: "+ this.name + " Matrikelnummer: " + this.matrikelnummer);
    }
    void printAllInformation(){
      for(Student aStudent: students){
        System.out.println("Name: " + aStudent.getName() + "Matrikelnummer: " +
                           aStudent.getMatrikelnummer());
      }
    }
    public String getName(){
      return name;
    }
    public int getMatrikelnummer(){
      return matrikelnummer;
    }
  
    boolean isValidMatNumber(){
      //Da die Matrikelnummer 5 stellig sein soll und nicht mit 0 anfangen darf,
      //habe ich diesen Zahlenbreich gewählt
      if (matrikelnummer &gt; 9999 &amp;&amp; matrikelnummer &lt; 100000){
        validMatNumber = true;
        return validMatNumber;
      }
      else{
        validMatNumber = false;
        return validMatNumber;
      }
    }
  
  
    static int getNumberOfStudents(){
      return numberOfStudents;
    }
  </code></pre>
  
  <p>And my testclass so far is (doesnt work tho):</p>
  
  <pre><code>public class StudentTest2{
  
    public static void main(String[] args){
  
      Student s1 = new Student(Peter, 12345);
    }
  }
  </code></pre>
  
  <p>i get the error </p>
  
  <p>StudentTest2.java:5: error: cannot find symbol
      Student s1 = new Student(Peter, 12345);
                               ^
    symbol:   variable Peter
    location: class StudentTest2</p>