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

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

ruby - Net::HTTP extremely slow responses for HTTPS requests -