• Top Posts

    Arrays in Kotlin


    Arrays in Kotlin :

    arrays are collection of Homogenous data,Kotlin supports arrays of different data types 

    Sample Program: 
    /* arula.in */

    fun main(args : Array<String>)
    {

    var samplearray : IntArray = intArrayOf(1,3,5,8)

    println("value of int array samplearray[2] :" + samplearray[2])
    }

    Result:


    value of int array  samplearray[2] :5

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728