title: Java. Creating new class similar to List
body: <p><img src="https://i.stack.imgur.com/sW0Zj.png" alt="Structure">
  I would like to create my own class, which had 3 fields. The first field - integer, the second would take objects (Strings, Lists), and the third would take integers. I do not understand two things.</p>
  
  <ol>
  <li>How to organize the storage of variables. I need to write a method in which the Array or List will save these values​​? How to save in object values?</li>
  <li><p>For second field. If the input is a String or a List so what Type is needed? and if I want to take as primitive types, then what? How to save object?</p>
  
  <blockquote>
  <pre><code>public class Record {
     private int[] number;
     private int[] count;
     private Object[] code;
  
     public void add(int newNumber, List&lt;String&gt; newCode, int newCount){
  
       return;
     };
  
     public void add(List&lt;String&gt; newCode, int newCount,){
  
         return;
     };
  </code></pre>
  </blockquote></li>
  </ol>
  
  <p>This doesn't work.</p>
  
  <pre><code>   Object nobj = new Object();
  nobj = "ss";
  </code></pre>