package com.oracle
fun testlet(arg: String?): Int {
arg?.let {
var contentLen = 1
if(arg.equals("hehe")) {
contentLen = 100
} else {
println("NOT equals!")
}
println("tesetlet: len: $contentLen")
return if(contentLen==100){11} else {2}
}
return 0
}
class Book {
var name = "《数据结构》"
var price = 60
fun displayInfo() = println("Book name : $name and price : $price")
}
fun main(args: Array<String>) {
println(testlet("hehe1"))
println("-----------")
val book2 = Book()
book2.name="tt"
book2.price = 77
book2.displayInfo()
val book = Book().let {
it.name = "《计算机网络》"
it.price = 10
println("book test...")
}
}