Is it optional to import Java packages in Scala? -


i find following scala program works ok without importing "java.lang.thread" (scala version 2.11.6):

object threadsmain extends app {     val t: thread = thread.currentthread()     val name = t.getname()     println(s"$name") } 

the output is:

main 

does mean there no need including java packages in scala program explicitly? or there rules?

as explained on scala homepage imports java.lang done automatically whereas other classes have imported explicitly.


Comments