title: How to call a method from class inside another class
body: <p>My main java code is like that:</p>
  
  <pre><code>package Javathesis;
  
  //import... etc
  //...
  
  
  public class Javathesis; // My main class
  
  { 
      public static void // There are a lot of these classes here
      //...
      //...
  
      class x
      {
          String a;
          String b;
  
          x(String a, String b)
          {
              this.a = a;
              this.b = b;
          }
      }
      public void getAllDataDB1
      {
          ArrayList&lt;ArrayList&lt;x&gt;&gt; cells = new ArrayList&lt;&gt;();
          while(resTablesData1.next()) 
          {
              ArrayList&lt;CellValue&gt; row = new ArrayList&lt;&gt;();
              for (int k=0; k&lt;colCount ; k++) {
              String colName = rsmd.getColumnName(i);
              Object o = resTablesData1.getObject(colName);
              row.add(new x(rsmd.getColumnType(),o.toString());
          }
          cells.add(row);
      }
  
      public static void main(String[] args) 
      {
          connectToDB1();
          // i want to call an instance of class "x" HERE!!!
      }
  }
  </code></pre>
  
  <p>How can i call class x in public static void main? Am i doing something wrong? I already test the way i know</p>
  
  <pre><code>Class class = new Class();
  class.x(String a, String b);
  </code></pre>
  
  <p>but i receive errors. Can somebody help me to fix this?
  Thanks in advance.</p>