Posts

Showing posts from June, 2026

Kotlin Comments

  package com.example.myapplication fun main (args: Array<String>) { // This is single line comment and I have shown simple "Hello World" as shown below println ( "Hello world!" ) // This is also a single line comment /* A multi-line comment in Kotlin starts with /* and end with */. So any text written in between /* and */ will be treated as a comment and will be ignored by Kotlin compiler. Multi-line comments also called Block comments in Kotlin.*/ /* This is a multi-line comment, and it can span * as many lines as you like */ println ( "Above shown is multi-line comments" ) /* This is a multi-line comment, and it can span * as many lines as you like /* This is a nested comment */ // Another nested comment */ println ( "Above shown is kotlin nested comments" ) } OUTPUT : Hello world! Above shown is multi-line comments Above shown is kotlin nested comments Process finished with exit c...

Kotlin basic syntax

  package com.example.myapplication fun main (args: Array<String>) { println ( "Hello World" ) println ( 20 ) println ( 20 + 20 ) var string12 : String = "Hello kotlin, how are you ?" println (string12)      println ( "Hello, World!" )      println ( "Hello" )      println ( "Whole world!" )      print ( "How are you ?" )      println ( " Next time we will meet!" )      println ( 200 )      println ( "200" )      println ( 2 + 2 )      println ( 4 * 3 )      println ( "I am without semi-colon" )      println ( "I am with semi-colon" );      println ( "1" ); println ( "2" ) } OUTPUT : Hello, World! Hello Whole world! How are you ? Next time we will meet! 200 200 4 12 I am without semi-colon I am with semi-colon 1 2 Process finished with exit code 0