// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package opgave;

import java.util.*;

abstract public class Question {
   private String name;

   private ArrayList childs;

   public Question(String name) {
      this.name = name;
      childs = new ArrayList();
   }

   public void addChild(Question q) {
      childs.add(q);
   }

   public void print() {
      print("");
   }

   public void print(String ind) {
      System.out.println(ind + name);
      for (int i = 0; i < childs.size(); i++) {
         Question q = (Question) childs.get(i);
         q.print(ind + "  ");
      }
   }
}
