I am new to Scala and I have setup an environment with IntelliJ. I found out one problem I could not explain, here is the code:
object HelloWorld extends App{
print("before")
var aMap = Map("A"->1, "B"->2)
println("after")
println(aMap)
}
I noticed that println(aMap) could clearly print out the Map("A"->1, "B"->2), so I want to debug and found out if Map has implemented an funcn which will be called by println, using IntelliJ. So I set a debug point on:
println(aMap)
When I "step into" the function, it seems var aMap = Map("A"->1, "B"->2) was called again! So , whats the reason that this was called a second time?
vartoval?