Working with JavaFX Classes and Objects |
|
|
insert 8 after mySequence [6];
for (i in mySequence){
java.lang.System.out.println(“value: “+i);
}
Produces output as below:
value: 1
value: 2
value: 3
value: 4
value: 5
value: 6
value: 7
value: 8
Deleting an element from a sequence:
delete mySequence;
delete n from mySequence;
delete mySequence [index];
delete mySequence [n..m];
For example, the code below:
var mySequence = [1..10];
delete 1 from mySequence;
for (i in mySequence){
java.lang.System.out.print(i);
}
java.lang.System.out.println(“”);
delete mySequence [1];
for (i in mySequence){
java.lang.System.out.print(i);
}
java.lang.System.out.println(“”);
delete mySequence [2..4];
for (i in mySequence){
java.lang.System.out.print(i);
}
java.lang.System.out.println(“”);
delete mySequence;
for (i in mySequence){
java.lang.System.out.print(i);
}
Produce output as below:
2345678910
245678910
248910
Working with JavaFX Classes and Objects |
|
Aug 2008 | Java Jazz Up |26 |
|
|
|
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63, Download PDF |
|
|
|