Java Arrays and jarray

The closest thing to a Java array in Python is a tuple. Remember that a tuple is immutable and a list is mutable. Like a list, a Java array is mutable but, like a tuple, it's of fixed length. You may think that a tuple or a list is a likely candidate for an array, but that's not exactly the case. You see, an array is like a homogeneous tuple or list—every item in it is of the same type; but a tuple is heterogeneous—items in it can be of different types. A lot of Java methods have Java arrays as arguments, so when you pass an array to a Java method, Python has to guarantee that it will be homogeneously typed.

Just a note: Because they're strongly typed, Java arrays can hold Java objects or primitive types.

Jython adds

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.