Fahad/CodeSamples/PredefineClassOf.scala
changeset 44 a751aa1ee4f7
equal deleted inserted replaced
43:10e7a90d8e7a 44:a751aa1ee4f7
       
     1 package Main
       
     2 
       
     3 object ClassReprTest {
       
     4   abstract class Bar {
       
     5     type T <: AnyRef
       
     6     def bar(x: T) {
       
     7       println("5: " + x.getClass())
       
     8     }
       
     9   }
       
    10   def main(args: Array[String]) {
       
    11     println("1: " + args.getClass())
       
    12     println("2: " + classOf[Array[String]])
       
    13     
       
    14     new Bar {
       
    15       type T = Array[String]
       
    16       val x: T = args
       
    17       println("3: " + x.getClass())
       
    18       println("4: " + classOf[T])
       
    19     }.bar(args)
       
    20   }
       
    21 }