I want to access nodes[i] globally in every method, where am I wrong?
class file{
    private static java.io.File file;
    private static BufferedReader reader;
    private static int[] nodes;
    
    static {
            try {
                file = new java.io.File("/home/madhu/Desktop/readData.txt");
                reader = new BufferedReader(new FileReader(String.valueOf(file)));
                String totalNode = reader.readLine();
                String[] strs = totalNode.trim().split(",");
                 for (int i = 0; i < strs.length; i++) {
                        int a = Integer.parseInt(strs[i]);
                        nodes[i]=a;
                 }
           } catch (IOException e) {
                e.printStackTrace();
           }            
    }
    private static void level() {
        System.out.println(nodes[2]);
    }
    public static void main(String[] args) throws Exception {
        System.out.println(nodes[2]);
    }
}
readData.txt contains :
1,2,4  
I want to use the individual number in further calculations, so how to access it independently?
 
     
    