Scala 惰性加载
作者:互联网
1 package com.atguigu.chapter04 2 3 object Test_Lazy { 4 def main(args: Array[String]): Unit = { 5 lazy val result : Int = sum(13,12) 6 println("1. 函数调用") 7 println("2. result = " + result) 8 } 9 def sum(a: Int ,b:Int):Int = { 10 println("3. sum调用!") 11 a+b 12 } 13 }
标签:13,Scala,Int,sum,惰性,result,println,def,加载 来源: https://www.cnblogs.com/rainbow-1/p/15817328.html