Znav |
---|
next | Java Mapping for Dictionaries |
---|
prev | Java Mapping for Structures |
---|
|
A Slice sequence maps to a Java array. This means that the Slice-to-Java compiler does not generate a separate named type for a Slice sequence.
For example:
Wiki Markup |
---|
{zcode:slice}
sequence<Fruit> FruitPlatter;
{zcode} |
This definition simply corresponds to the Java type Fruit[]
. Naturally, because Slice sequences are mapped to Java arrays, you can take advantage of all the array functionality provided by Java, such as initialization, assignment, cloning, and the length
member. For example:
Wiki Markup |
---|
{zcode:java}
Fruit[] platter = { Fruit.Apple, Fruit.Pear };
assert(platter.length == 2);
{zcode} |
Alternate mappings for sequence types are also possible.
See Also
Znav |
---|
next | Java Mapping for Dictionaries |
---|
prev | Java Mapping for Structures |
---|
|