update idea

This commit is contained in:
Yutousama 2022-05-11 17:14:10 +08:00
parent aa0db58531
commit 00bf7c5676
4 changed files with 44 additions and 13 deletions

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -0,0 +1,39 @@
package Demo1
class InitAndSingleton{
//初始化
init{
println("init")
}
//带参构造方法
constructor(data:String){
println("data = ${data}")
}
//构造方法
constructor(){
println("not parma")
}
//定义静态方法
companion object{
//方法实现
fun function() {
println("is Function")
}
}
}
fun main() {
InitAndSingleton()
InitAndSingleton("uname")
InitAndSingleton.function()
}
/** out **
init
not parma
init
data = uname
is Function
**/

View File

@ -1,13 +0,0 @@
class InitAndSingleton{
//初始化
init{
println("init")
}
//定义静态方法
companion object{
//方法实现
fun function(){
}
}
}