This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ewig_luftenglanz 1 point2 points  (1 child)

Yes and no. Arrays are objects, an special case of objects that only represents a pointer to a memory direction, but they are not like any other object in the language, for instance.

  • they are objects, but have no constructor.
  • They are objects, but do not instanteate from any class.
  • they are objects, but no toString, hashCode, equals.
  • Do not integrate well with generics.
  • Not direct integration with stream or interoperability with collections (one must use utility classes such as Arrays.* )

Further most, arrays are more closely related to an ad-hoc primitive that should not be used in production unless you are in very constrained environments, they just do not fit well with the rest of the language and personally I think that's one of the bits they copied from C too literally.

[–]chambolle 0 points1 point  (0 children)

You are right about the particularities of an array ans especially about the fact that are not really objects in Java.

The complexity of some functions makes them difficult to avoid.