title: How do I create a constructor for a class that is inheriting from an abstract class with generics?
body: <p>My university professor shared this class with us (it's essentially a generic parser using Gson):</p>
  <pre class="lang-java prettyprint-override"><code>public abstract class GenericDAO&lt;T&gt; {
      final Class&lt;T&gt; clase;
      protected File archivo;
  
      public GenericDAO(Class&lt;T&gt; clase, String file) throws Exception {
          this.clase = clase;
          this.archivo = new File(file);
          this.archivo.createNewFile();
      }
  
      public List&lt;T&gt; getAll(Class&lt;T&gt; clase) throws Exception {
          List&lt;T&gt; list = new ArrayList&lt;T&gt;();
          FileReader f = new FileReader(archivo);
          BufferedReader b = new BufferedReader(f);
          Gson g = new Gson();
          String line = &quot;&quot;;
  
          try {
  
              while ((line = b.readLine()) != null &amp;&amp; !line.equals(&quot;&quot;)) {
                  JsonParser parser = new JsonParser();
                  JsonObject jsonObject = parser.parse(line).getAsJsonObject();
                  list.add(g.fromJson(jsonObject, clase));
              }
              b.close();
          } catch (Exception e) {
              e.printStackTrace();
              return list;
          }
          return list;
      }
  
      // a lot of other methods to read/write to json files
  }
  </code></pre>
  <p>I created a class that inherits from it so I can read a Business from a file:</p>
  <pre class="lang-java prettyprint-override"><code>public class Business extends GenericDAO&lt;Business&gt; {
      private String name;
      // a lot of other members
  
      // this was automatically generated by Intellij:
      public Business(Class&lt;Business&gt; clase, String file) throws Exception {
          super(clase, file);
      }
  }
  </code></pre>
  <p>Intellij automatically generated a constructor for it, but I don't understand it. Why does the constructor has a class as a parameter, do I have to pass an instance of itself to it? That doesn't make sense.</p>
  <p>I would be grateful if you can point me to either some documentation to read through, or explain the pattern my professor is using.</p>
  <p>Edit: to sum up, how do I instantiate my business class then? This is throwing an error:</p>
  <pre class="lang-java prettyprint-override"><code> Business client = new Business(Business, &quot;path_to_json_file.json&quot;);
  </code></pre>