title: Getting FATAL EXCEPTION: main java.lang.StackOverflowError when creating an object
body: <p>I have a class called GetQuestions in which I would like to create an object to later asign values to its properties like this:</p>
  
  <pre><code>public class GetQuestions implements Serializable {
  
  public int questionNumber = 1;
  Question question =  new Question();
  
  public String[] mCategories = new String[]{
          "Geografia*",
          "Matematicas",
          "Arte",
          "Ciencia",
          "Ocio",
          "Deportes",
          "Historia"
  
  };
  public String[] mSomeQuestions = new String[]{
          "Cuantgo es 2 mas dos*",
          "Que edad tengo",
          "Pregunta random",
          "Que edad tienes",
          "Y si...?",
          "Aaron es tonto?",
          "Ivan es mas tonto que Aaron? "
  
  };
  
  public void getNewQuestion(){
      int idx = new Random().nextInt(mCategories.length);
      question.mCategory=mCategories[idx];
      question.mDescription=mSomeQuestions[idx];
      question.setArrayofAnswers("Some Answer","This Answer","No, that answer","Could it be this one?");
  
  }
  
  public void plusOne(){
      this.questionNumber++;
  }
  
  
   }
  </code></pre>
  
  <p>And this is the class Question:</p>
  
  <pre><code>public class Question extends GetQuestions implements Serializable{
  
  
  public String mCategory;
  public String mDescription;
  public String answer;
  public ArrayList&lt;Integer&gt; mAlr =  new ArrayList&lt;Integer&gt;();
  public ArrayList&lt;String&gt; mAnswers = new ArrayList&lt;String&gt;();
  
  public int asignButtons(){
      int idx = new Random().nextInt(mAnswers.size());
      if(mAlr.contains(idx)){
          while (mAlr.contains(idx)) {
              idx = new Random().nextInt(mAnswers.size());
          }
      }
  
     answer=mAnswers.get(idx);
      return idx;
  }
  
  public void setArrayofAnswers( String mAnswer1, String mAnswer2, String mAnswer3,String mAnswer4){
      mAnswers.add(mAnswer1);
      mAnswers.add(mAnswer2);
      mAnswers.add(mAnswer3);
      mAnswers.add(mAnswer4);
  }
  
    }
  </code></pre>
  
  <p>But I'm getting this error, some help? I kinda new to Java and Android so I don't know what I may be doing wrong.</p>
  
  <pre><code>09-02 11:06:20.168  17036-17036/es.hol.gustavo.testchanging D/OpenGLRenderer﹕ Enabling debug mode 0
  09-02 11:06:22.865  17036-17036/es.hol.gustavo.testchanging I/dalvikvm﹕ threadid=1: stack overflow on call to Les/hol/gustavo/testchanging/GetQuestions;.&lt;init&gt;:V
  09-02 11:06:22.865  17036-17036/es.hol.gustavo.testchanging I/dalvikvm﹕ method requires 36+20+8=64 bytes, fp is 0x41a75314 (20 left)
  09-02 11:06:22.866  17036-17036/es.hol.gustavo.testchanging I/dalvikvm﹕ expanding stack end (0x41a75300 to 0x41a75000)
  09-02 11:06:22.866  17036-17036/es.hol.gustavo.testchanging I/dalvikvm﹕ Shrank stack (to 0x41a75300, curFrame is 0x41a7aec4)
  09-02 11:06:22.866  17036-17036/es.hol.gustavo.testchanging D/AndroidRuntime﹕ Shutting down VM
  09-02 11:06:22.866  17036-17036/es.hol.gustavo.testchanging W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41b15d40)
  09-02 11:06:22.927  17036-17036/es.hol.gustavo.testchanging E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: es.hol.gustavo.testchanging, PID: 17036
  java.lang.StackOverflowError
          at es.hol.gustavo.testchanging.Question.&lt;init&gt;(Question.java:12)
          at es.hol.gustavo.testchanging.GetQuestions.&lt;init&gt;(GetQuestions.java:18)
  </code></pre>
  
  <p>Thank you if you can help.</p>