I was confused because I don't have to use inherit...
# announcements
a
I was confused because I don't have to use inheritance to do that in Java or C++.
k
You don't really have to do that in Kotlin either?
I just decided to inherit
Iterator
because that's what you asked for.
a
By iterator I meant any kind of pointer to node with public interface.
I just want to be able to store references to LinkedList's nodes without an ability to break it's structure, no need to inherit anything (although it's better to add some interfaces from designer's point of view)
Can you do that without inheritance?
k
Hmm, you're right, I can't really get something like this to work:
Copy code
class MyClass{
	fun getPublic() = Public(Private()))
	
	private class Private
	
	public class Public(private val node: Node)
}