summaryrefslogtreecommitdiff
path: root/sources/examples/sort.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2004-01-08 19:10:55 +0000
committermichelou <michelou@epfl.ch>2004-01-08 19:10:55 +0000
commitf5919ef574e6d6cbdf96835db6f53ea80dca0991 (patch)
tree3a5d86d07a771e2456edb6b4969cb78a2de735bb /sources/examples/sort.scala
parent2f487fd928d6ceb83b04c890e57ba2f0f71af6d9 (diff)
downloadscala-f5919ef574e6d6cbdf96835db6f53ea80dca0991.tar.gz
scala-f5919ef574e6d6cbdf96835db6f53ea80dca0991.tar.bz2
scala-f5919ef574e6d6cbdf96835db6f53ea80dca0991.zip
- now uses the Array function to initialize an ...
- now uses the Array function to initialize an array.
Diffstat (limited to 'sources/examples/sort.scala')
-rw-r--r--sources/examples/sort.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/sources/examples/sort.scala b/sources/examples/sort.scala
index 2c3c3666a5..38a9755774 100644
--- a/sources/examples/sort.scala
+++ b/sources/examples/sort.scala
@@ -34,12 +34,11 @@ object sorter {
ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "");
if (ar.length == 0) "" else iter(0)
}
- Console.println("[" + print1 + "]");
+ Console.println("[" + print1 + "]")
}
def main(args: Array[String]) = {
- val xs = List(6, 2, 8, 5, 1);
- val ar = xs.copyToArray(new Array[Int](xs.length), 0);
+ val ar = Array(6, 2, 8, 5, 1);
println(ar);
sort(ar);
println(ar)