Name
zeros
Synopsis
zeros(length,typecode)
Creates a Java array z with length
length and elements of the class or type
given by typecode, which has the same
meaning as in function array.
zeros initializes each element of
z to 0,
null, or false, as appropriate
for the type or class. Of course, when you access such elements from
Jython code, you see them as the equivalent Python
0 values (or None as the Jython
equivalent of Java null), but when Java code
accesses the elements, it sees them with the appropriate Java types
and values.
You can use instances created by functions array
and zeros as Python sequences of fixed length.
When you pass such an instance to a Java method that accepts an array
argument and modifies the argument, the changes are visible in the
instance, so your Python code can effectively call such methods.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access