Follow the below steps to create your first kotlin Project in IntelliJ IDE.
We have executed a program, let's discuss the components in the programs, I have highlighted them below.
Comments are nothing but informational lines for the user.
The Compiler doesn't count the comments as the member for the compilation, so whatever is present in a comment, the compiler will ignore them.
There two types of comments :
fun is keyword used to denote that, this block is a function
this is nothing but a function name, it could contain any name, the main function is the place where the execution starts.
this is parameter name, a function can accept n-number of parameters. Parameter follows all the variables properties
this is nothing but the parameter type, unlike other languages, In kotlin variable comes first and then the variable type. Types could be anything, here we are accepting Array with generic
braces are used to contain the elements inside the block, if we write outside anything then it belongs to other function or class
println() is nothing but a function which will direct the given value into the console of the ide/terminal
this value could be any type, and this value will be redirected to console after resolving the values (as of this, we have not elements to resolve)