访问对象';java中多个ArrayList中的s属性

访问对象';java中多个ArrayList中的s属性,java,object,arraylist,vector,Java,Object,Arraylist,Vector,我只写了必要的信息让你理解错误。 我有一个多数组列表(规范),即 节点是一个包含int和boolean的对象,即 node= int value , boolean explored 我想通过以下方式访问node对象的int System.out.println(speci.get(0).get(0).value); // IDE is not accepting it, suggest a way 我的IDE(NetBeans8.1)不接受,表示找不到符号值。如何使用ArrayList访问

我只写了必要的信息让你理解错误。 我有一个多数组列表(规范),即

节点是一个包含int和boolean的对象,即

node= int value , boolean explored
我想通过以下方式访问node对象的int

System.out.println(speci.get(0).get(0).value); // IDE is not accepting it, suggest a way

我的IDE(NetBeans8.1)不接受,表示找不到符号值。如何使用ArrayList访问该值?TIA:-)

节点中
类为字段定义
getter
,然后使用-

System.out.println(speci.get(0).get(0).getValue());
在一种假设下,
speci
在某种程度上-

ArrayList<ArrayList<node>> speci;

这里有一个有用的链接

你的答案并不能解释OP为什么会出错。@k32322aftabhussain我写了一个假设。请在问题本身中分享您的完整代码,以便进一步了解情况。
ArrayList<ArrayList<node>> speci;
public class Node {
    int value;
    ... // other attributes
    int getValue() {
        return value;
    }
    ...// other getters and setters
}