Array
classin packageklyn.collections
public class Array<T> extends Object:
Fixed-size contiguous array.
This collection stores a fixed number of elements. Unlike `ArrayList<T>`,
its length is decided at construction time and cannot change afterwards.
The language also exposes the shorthand syntax `T[]` for this type and
`T[n]` for array allocation.
import klyn.collections
data as UInt[] = UInt[3]
data[0] = 10u
data[1] = 20u
data[2] = 30u
print(data) # [10, 20, 30]
print(data.size) # 3
@param <T> Element type.
@since 1.0
Properties
| Modifier and Type |
Member |
Description |
| public readonly native property |
size |
Returns the number of elements in the array. |
Constructors
| Modifier and Type |
Member |
Description |
| public native |
Array |
Creates a new array with a fixed number of elements. |
Methods
| Modifier and Type |
Member |
Description |
| public |
join |
Joins array elements into a single string. |
| public override |
toString |
Returns the Python-like textual representation of the array. |
Operators