Casts @array into an object scalar representing a native java array.
$ cast("string", 'b'|'c')Casts the specified string of byte data into a 1-dimensional native java byte or character array
@array - the array to cast into a native java array. A copy of this array is flattened before conversion.
"string" - a string used to represent an array of bytes or characters
't' - the type of this new native array
You may also specify a Character Description b byte c char d double f float h short i int l long z boolean o java.lang.Object * Java Object (determined by class of scalars object value) ^Class
literal to cast to something specific.
... - the dimensions of the native array. i.e. 2, 2 would mean a 2x2 array.
A sleep scalar with a reference to a java array Object of the specified type and dimensions.
@array = @("a", "b", "c", "d", "e", "f"); $casted = cast(@array, "*", 2, 3); # create a 2x3 array println("Class is: " . [$casted getClass]);
Class is: class [[Ljava.lang.String;