GIGO: words unreadable aloud
Mishrogo Weedapeval
 

 

  Saturday 5 June 2004
Chapter 5, Exercise 3

This one's very similar in Scala to the Java version...

c5x3a.scala:

package x;
import java.util.Vector;
import c5x3v.Vector;
object c5x3a {
    def main ( args: Array[String] ) = {
        var v = new Vector;
    }
}

c5x3v.scala:

package c5x3v;
class Vector {
    var size : Int = _;
}

Gets me this error, quite similar to what Java says:

c5x3a.scala:7: reference to Vector is ambiguous;
it is imported twice in the same scope by
    import c5x3v.{Vector}
and import java.util.{Vector}
        var v = new Vector;
                    ^
one error found

11:33:45 PM   comment/     


Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2007 Doug Landauer .
Last update: 07/2/6; 12:40:18 .
Click here to send an email to the editor of this weblog.

June 2004
Sun Mon Tue Wed Thu Fri Sat
    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      
May   Jul

Previous/Next