我的主要java代码是这样的:
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<ArrayList<x>> cells = new ArrayList<>();
while(resTablesData1.next())
{
ArrayList<CellValue> row = new ArrayList<>();
for (int k=0; k<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!!!
}
}
我如何在 public static void main 中调用类 x?难道我做错了什么?我已经测试了我知道的方式
Class class = new Class();
class.x(String a, String b);
但我收到错误。有人可以帮我解决这个问题吗?提前致谢。