-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,659
  • 2
  • 20
  • 41
pigi
  • 45
  • 1
  • 4

1 Answers1

1

You need to use list.size() instead.

Mohammed Aouf Zouag
  • 17,042
  • 4
  • 41
  • 67