Kotlin主要功能参数中的内容 [英] the content in the parameter of the main fun in kotlin
本文介绍了Kotlin主要功能参数中的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Kotlin语言的初学者,所以我想了解这种编程语言中的所有内容.
I'm a beginner of Kotlin language and I want to understand everything in this programming language so.
1-主函数参数中的args: Array<String>
是什么意思?
1- what mean of the args: Array<String>
in the parameter of the main function ?
2-为什么删除此行时会显示编译错误?
2- why compilation error is shown when this line is removed ?
推荐答案
我一直到处都用vararg
替换它
object Application {
@JvmStatic
fun main(vararg args: String) {
Micronaut.build()
.packages("example")
.mainClass(Application::class.java)
.start()
}
}
这篇关于Kotlin主要功能参数中的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文