-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathLists.kt
More file actions
51 lines (26 loc) · 904 Bytes
/
Lists.kt
File metadata and controls
51 lines (26 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
fun main() {
// Read-only (immutable)
val names = listOf("Ahad", "Turki", "Raghad", "Nasser", "Sumayah", "Fahdah")
val namesAll = listOf("Ahad", "Turki", "Raghad", "Nasser")
val color = listOf<String>()
// Read and Write (mutable)
val numbers = mutableListOf("one", "two", "three", "four", "five")
val weekDays = mutableListOf("Sun", "Mon", "Tue", "Wed", "Thurs", "Fri", "Sat")
// Read-Write (mutable) List - Operations
// Add (Element)
// Add (Index, Element)
// Add All (List)
// Add All (Index, List)
// Clear
// Remove
// Remove At
// Remove All
// Read-only (immutable) List - Operations
// The size of the list
// Contains
// Contains All
// get
// indexOf
// isEmpty
// Sublist
}