language: Scala (scala-2.10.0)
date: 937 days 14 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
object Main {
  import reflect.Manifest
  
  def typename[A](a: A)(implicit m: Manifest[A]) = m.toString
 
  def main(args: Array[String]) {
    val map = List("Hello", "World") // Here, I let the compiler infer the type for me.
    println(typename(map))
    val map2 = List[Any]("Hello", "World") // Here, I specify the type myself.
    println(typename(map2))
  }
}