package dragon
/**
* @Author: zhangQi
* @Date: 2020-09-20 18:12
*/
class Runoob constructor(name:String){
var url: String = "https://deadzq.github.io"
var country: String = "CN"
var siteName = name
init{
println("initialize site name is : ${name}")
}
fun printTest(){
println("我是类的函数")
}
}
fun main(args: Array<String>) {
val runoob = Runoob("deadzq的算法网站")
println(runoob.siteName)
println(runoob.url)
println(runoob.country)
runoob.printTest()
}
initialize site name is : deadzq的算法网站
deadzq的算法网站
https://deadzq.github.io
CN
我是类的函数
今天又继续把kotlin的demo加了一些