I'm working on this assignment .....

- Opened up a RandomAccessFile
- Looped through the file, using a counter (int i) to find the number of entries in the file
- Initialised array using int i
- Read data into the array, line by line

However, I cant work out a way to access the value of int i outside of the main method. If anyone could help, I'd really appreciate it. Thanks.

Lets see some of the code associated with int i. Really hard to guess from nothing but a description.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.