News for hackers. Stuff that matters.
Re:Git's list of banned C functions by wbl on Sunday March 07, 2021 @09:19PM (#26381755)
Which method? Note im talking about the language level array, not ArrayList. Also this was years ago.
Re:Git's list of banned C functions by int_19h on Sunday March 07, 2021 @11:35PM (#26382318)
Java arrays don't have add() at all - they're fixed-size once allocated.

ArrayList etc do have add(), and they implement it by re-allocating the backing array once capacity is exceeded.

In practice, you'd use the ArrayList anyway. I don't think it's worthwhile comparing Go and Java "language-only", because the standard library is as much a part of the language definition as the fundamental syntax; indeed, what goes where is largely arbitrary. E.g. maps in Go are fundamental, but the primary reason is that they couldn't be implemented as a library in Go with proper type safety, due to the lack of generics.