我创建了一个对象数组,然后在循环中初始化了数组。但是当我用对象数组调用一个方法时,它告诉我,变量还没有被初始化。我做错了什么,我该如何做对?
Objects[] = object;
for (int i = 0; i < someMap.size(); i++) {
object = new Object[someMap.size()];
for (Entry e : someMap.entrySet) {
object[i] = new Object(var1, var2, var3);
}
}
somemethod(somevar, object); //Eclipse tells me: The local variable object may not have been initialized