-3

the problem follows. When I use int[] list = new int[3] then list.length works, but if I use ArrayList<Integer> list = new ArrayList<Integer>(); list.length does not work, I'm new and would appreciate help.

Uma Kanth
  • 5,664
  • 2
  • 18
  • 41
pigi
  • 25
  • 1
  • 4

1 Answers1

1

You need to use list.size() instead.

Mohammed Aouf Zouag
  • 16,747
  • 3
  • 39
  • 66