What is indices meaning in kotlin

0 votes

I want to know actually how .indices works and what is the main difference is between this two for loops.

for (arg in args)
    println(arg)

or

for (i in args.indices)
    println(args[i])

And what is use of withIndex() function

for ((index, value) in array.withIndex()) {
    println("the element at $index is $value")
}
Jun 22 in Kotlin by Harshitha
• 160 points
7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Kotlin

0 votes
0 answers

Accessibility implementation for Google Maps Marker in Android Kotlin

have to announce some customised content for ...READ MORE

Jun 22 in Kotlin by Harshitha
• 160 points
8 views
0 votes
1 answer

What is the meaning of “int(a[::-1])” in Python?

Assumming a is a string. The Slice ...READ MORE

answered Aug 27, 2018 in Python by Priyaj
• 58,080 points
3,368 views
+2 votes
1 answer

What is the meaning of "this" keyword in Java?

public class MyThisTest { private int ...READ MORE

answered Oct 10, 2018 in Java by Daisy
• 8,120 points
349 views
0 votes
1 answer

What is the meaning of Write Ahead Log in Hadoop?

Write Ahead Log (WAL) is a file ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Sunil
967 views
0 votes
1 answer

What is the meaning of retries in Kafka Producer API?

Hi@akhtar, It defines how many time the producer ...READ MORE

answered Feb 11, 2020 in Apache Kafka by MD
• 95,360 points
2,908 views
0 votes
1 answer

What is the meaning of term “Glance” in OpenStack service?

Hi@akhtar, Glance is image service in OpenStack. The ...READ MORE

answered Mar 16, 2020 in OpenStack by MD
• 95,360 points
417 views
0 votes
1 answer

.What is the meaning of "while True :" while doing in a loop.

The body of the loop will continue ...READ MORE

answered Oct 7, 2020 in Python by Gitika
• 65,850 points
129 views
0 votes
1 answer
0 votes
1 answer

What is the meaning of Duration in Amazon RDS Backup window

The duration window indicates the time in which ...READ MORE

answered Mar 2 in Power BI by gaurav
• 13,460 points
86 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP