Why would you need it explicitly?
ArrayList
is a list backed by an array. You know how big an array can be. It's defined in the java spec (even just by the fact that you must index them with an int
), and that is (approximately, since there's that -8
) your answer. Why else do you need to programmatically know it?