Reply to post: Noob question

Sick of Java and C++? Google pours a cup o' Kotlin for Android devs

GrapeBunch
Paris Hilton

Noob question

Noob question. Maybe it's even a pre-noob question. It's not just Kotlin that does this, but other languages, and I've never found an explanation in the typical Hello World beginner documents:

package hello

fun main(args: Array<String>) {

println("Hello World!")

}

In annotating fun main(args: Array<String>), the Kotlin frontpage describes it thusly: "Package-level function, which takes an Array of strings as a parameter".

"Hello World!" is a string. So why do you need to create a program(me) argument, an array of strings, that you aren't going to use in the program proper? My first thought was that it allows you to set some sort of errorlevel. Second thought: required by the built-in function println. Thanks in advance for the real answer ....

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon