Hello World
Hello, World!
Target: JVMRunning on v.1.8.20
- kotlin码通常定义在包.包定义可选:如你不定义包在源文件,它的内容成默认包.Kotlin code is usually defined in packages. Package specification is optional: If you don't specify a package in a source file, its content goes to the default package.
- 切入点对kotlin app是main功.从kotlin1.3,你可声明main不需参数.返回类型不指定,意味功返回不无.An entry point to a Kotlin application is the
main
function. Since Kotlin 1.3, you can declaremain
without any parameters. The return type is not specified, which means that the function returns nothing. println写行尔标准输出.它导入隐含地.也注意分号可选.println
writes a line to the standard output. It is imported implicitly. Also note that semicolons are optional.
在kotlin版本早于1.3,main功必有参数尔类型
Array<String>
.In Kotlin versions earlier than 1.3, the main
function must have a parameter of type Array<String>
.fun main(args: Array<String>) {
println("Hello, World!")
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)