There was an error while loading. Please reload this page.
1 parent 52dc465 commit d425aa3Copy full SHA for d425aa3
list/ArrayList.java
@@ -44,9 +44,8 @@ public E get(int i) throws IndexOutOfBoundsException {
44
}
45
46
public void getData() {
47
- for (int i = 0; i < data.length; i++) {
48
- int j = i + 1;
49
- System.out.println("Element at: " + (j) + " is: " + data[i]);
+ for (int i = 0; i < size; i++) {
+ System.out.println("Element at: " + (i + 1) + " is: " + data[i]);
50
51
52
0 commit comments