Arrays: Difference between revisions

Content added Content deleted
No edit summary
Line 1,203: Line 1,203:


=={{header|Ceylon}}==
=={{header|Ceylon}}==
{{works with|Ceylon|1.3.0}}
<lang ceylon>import ceylon.collection {
<lang ceylon>import ceylon.collection {


Line 1,211: Line 1,212:
// you can get an array from the Array.ofSize named constructor
// you can get an array from the Array.ofSize named constructor
variable value array = Array.ofSize(10, "hello");
value array = Array.ofSize(10, "hello");
value a = array[3];
value a = array[3];
print(a);
print(a);
array.set(4, "goodbye"); //sorry, you can't do array[4] = "goodbye"
array[4] = "goodbye";
print(array);
print(array);