Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 82aec1a

Browse files
Sugar code made for ArrayList.kt
1 parent 3aa4da4 commit 82aec1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/ArrayList.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fun main() {
3232

3333
for (age in ageList) {
3434

35-
println("Age : "+age)
35+
println("Age : $age")
3636
}
3737

3838

@@ -41,12 +41,12 @@ fun main() {
4141

4242

4343
// The get() function of ArrayList class is used to retrieve the element present at given specified index.
44-
println("ageList.get(1) : ${ageList.get(1)}")
44+
println("ageList.get(1) : ${ageList[1]}")
4545

4646

4747
// The set() function of ArrayList class is used to set the given element at specified index and replace
4848
// if any element present at specified index.
49-
ageList.set(0, 45)
49+
ageList[0] =45
5050

5151

5252
// The indexOf() function of ArrayList class is used to retrieve the index value of first occurrence of element or

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /