I am new to scala.In Future, I saw it used in two different way i.e Future and future.
Example:
val sayHello = Future {
Thread.sleep(1000)
"hello"
}
Similarly,
val sayHello = future {
Thread.sleep(1000)
"hello"
}
But I didn't find any difference in Output. I will be pleased if anybody
makes it clear to me.
It is the same thing indeed, and future (lowercase) is actually deprecated since 2.11.0.
See the actual code in scala lang: https://github.com/scala/scala/blob/v2.12.0/src/library/scala/concurrent/package.scala#L101
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With