You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your topic request related to a problem? Please describe.
There is already some information about iterator in cycles and strings topics. Arrays (that ofc related to iterators) is very important structure to explain.
Describe the solution you'd like
I'd like to tell more about iterator (how it works in order to OOP in Kotlin). And make kinda example:
classElement(varstring:String, varnext:Element?)
classElements(privatevarinitial:Element) : Iterable<Element> {
privatevar first:Element= initial
funiterator(): Iterator {
returnobject:Iterator {
privatevar current:Element= first
overridefunhasNext(): Boolean {
return current.next !=null
}
overridefunnext(): Element {
val output = current
current = current.next ?:throwIllegalStateException()
return output
}
}
}
}
Also example with own range realization.
What place topic should have? Why?
It should be after nullable and throwables topics.
The text was updated successfully, but these errors were encountered:
Is your topic request related to a problem? Please describe.
There is already some information about iterator in cycles and strings topics. Arrays (that ofc related to iterators) is very important structure to explain.
Describe the solution you'd like
I'd like to tell more about iterator (how it works in order to OOP in Kotlin). And make kinda example:
Also example with own range realization.
What place topic should have? Why?
It should be after nullable and throwables topics.
The text was updated successfully, but these errors were encountered: