Are arrays passed by value or passed by reference in Java? [duplicate]

Arrays are not a primitive type in Java, but they are not objects either, so are they passed by value or by reference? Does it depend on what the array contains, for example references or a primitive type?

7 Answers
7

Leave a Comment