Steve Luke wrote:> accounting.engine.ViewRecords.viewGeneralJournal(ViewRecords.java:24)
At that line of code you must be accessing an ArrayList like: list.get(0) -> which should get you the first value of the list. But:
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
This part of the exception tells you the ArrayList you are accessing has a Size of 0, so the Index of 0 (the first Object in the list) can't be found. So your problem is that you are trying to get something from an empty ArrayList. The solution is to avoid doing that. Check the size of the ArrayList before you retrieve anything from it. And if not (Size of List > Index To Retrieve) show an error saying the the desired record does not exist.
I read that file from the hard disk which had 5 different elements and all those were saved in this ArrayList but when I print the ArrayList using the following code, it says above error.
for(int i =0; i<this.GeneralJournal.size();i++){
System.out.println(this.GeneralJournal.get(i));
}
>