Defer the print

Report a typo

Let's make val evaluate lazy to have the following output:

print this
then this

Sample Input 1:

Sample Output 1:

print this
then this
Write a program in Scala 3
@main def main =
??? val second = println("then this")
println("print this")
second
___

Create a free account to access the full topic