Java:
List
nameList.add("html");
nameList.add("body");
nameList.add("table");
nameList.add("tr");
nameList.add("td");
Iterator
while(iterator.hasNext()) {
String name = iterator.next();
System.out.println(name);
if(name.equals("table")) {
break;
}
}
Squeak:
nameList := OrderedCollection new.
nameList add: 'html'.
nameList add: 'body'.
nameList add: 'table'.
nameList add: 'tr'.
nameList add: 'td'.
nameList do: [:name |
Transcript cr; show: name.
name = 'table' ifTrue: [^ nil].
].
0 件のコメント:
コメントを投稿