Difference between def and val in Scala
Oftentimes, val and def can get confusing in Scala. Especially when there are no parameters to a function. Let me explain with an example:
object HelloWorld {
val total: Int = 123
def totalDef: Int = {
println("Inside def")
4...
itsadityagupta.hashnode.dev2 min read