{"author_name":"Naotsugu","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog1.mammb.com%2Fentry%2F20090616%2F1245164358\" title=\"\u9045\u5ef6\u521d\u671f\u5316 - A Memorandum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"A Memorandum","title":"\u9045\u5ef6\u521d\u671f\u5316","description":"lazy \u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u3066\u9045\u5ef6\u521d\u671f\u5316\u3092\u7c21\u5358\u306b\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306e\u5834\u5408\u3001 class Emp(id:Int) { def getId = id val str : String = {println(\"init\"); \"lazy?\"} } object Example030 extends Application { val t = new Emp(10) println(t.getId) } \u5b9f\u884c\u7d50\u679c\u306f\u3001 init 10 lazy\u3092\u4ed8\u3051\u3066\u307f\u308b\u3068\u5fc5\u8981\u6642\u306b\u306e\u307f\u521d\u671f\u5316\u3055\u308c\u307e\u3059\u3002 class Emp(id:Int) { def getId = id lazy val str : String = \u2026","categories":["Scala"],"published":"2009-06-16 23:59:18","url":"https://blog1.mammb.com/entry/20090616/1245164358","height":"190","version":"1.0","image_url":null,"blog_url":"https://blog1.mammb.com/","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/Naotsugu/","provider_url":"https://hatena.blog","type":"rich"}