Skip to content
  • Home
  • Blogs
  • QNA
    • Community
    • Ask
    • Questions
  • Explore
    • Tools
    • Computer Science
    • Electrical
    • Electronics
    • Digital Marketing
    • Technology
    • Hiring Process
    • Interview Questions
    • Roadmap
    • Comparison
    • What Is
    • Project
    • Top Things
    • TechNews
  • News?
  • Login
newlogo of cs Electrical And Elect
  • Home
  • Blogs
  • QNA
    • Community
    • Ask
    • Questions
  • Explore
    • Tools
    • Computer Science
    • Electrical
    • Electronics
    • Digital Marketing
    • Technology
    • Hiring Process
    • Interview Questions
    • Roadmap
    • Comparison
    • What Is
    • Project
    • Top Things
    • TechNews
  • News?
  • Login

How to create lists in Kotlin?

All Questions › Category: Kotlin › How to create lists in Kotlin?
0 Vote Up Vote Down
chetan shidling asked 5 years ago

I need short information.

1 Answers
0 Vote Up Vote Down
chetan shidling answered 5 years ago

Here is the code on how to create a list in Kotlin.
 
fun main(args : Array<String>){
var nums = listOf(1,2,3,4)

for(i in nums)
{
println(i)
}
}
 
Output:
 
1
2
3
4
 

Proudly powered by WordPress | RealEstate Pack Lite by Wp Theme Space.

WhatsApp us