hello world

Posted on   泰坦装甲  阅读(14)  评论(0编辑  收藏  举报
Hello World
 
 
 
 
 
 
package org.kotlinlang.play         // 1
fun main() {                        // 2
    println("Hello, World!")        // 3
}
 
 
Hello, World!
  1. 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.
  2. 切入点对kotlin app是main功.从kotlin1.3,你可声明main不需参数.返回类型不指定,意味功返回不无.An entry point to a Kotlin application is the main function. Since Kotlin 1.3, you can declare main without any parameters. The return type is not specified, which means that the function returns nothing.
  3. 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!")
}
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)

随笔 - 18, 文章 - 0, 评论 - 1, 阅读 - 1548

Copyright © 2025 泰坦装甲
Powered by .NET 9.0 on Kubernetes

点击右上角即可分享
微信分享提示