直接 print()
print("000")
换行 println()
println("111")
格式化打印 printf()
val name = "Bob" val age = 12 val addr = "SiChuan" printf("name = %s ; age = %d ; addr = %s",name,age,addr)
字符串插值
val name = "Bob" val age = 12 val addr = "SiChuan" print(s"name = $name ; age = $age ; addr = $addr")
版权声明:《 Scala 的四种打印 》为明妃原创文章,转载请注明出处!
最后编辑:2020-1-30 13:01:18