From the course: Build Spring Boot Apps with the Kotlin Programming Language

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Solution walk-through

Solution walk-through

- [Instructor] Okay well I hope you have had a go at that. I'm going to now code this up, and I think we'll start by creating a mutable list of states that we can then convert into the immutable list. So let's put up here our mutable list of states and I don't really want this variable to be visible outside of this class, so I think we'll make it a private variable, and I'm going to I think call it hiddenSeats. Meaning that this is the list of seats but it's going to be hidden from outside of this class, and that's going to be a mutable list of and it's objects of type seat. Now we'll obviously need to fill in what those hidden seats are but it does then mean that for our seats variable we can set that equal to hiddenSeats.list, actually the way we'll do it is say, there's a val called seats and its get is hiddenSeats.list. Okay so because of that then, what we'll need to do is to ensure that we can complete all the data that's going to go into our hidden seats and the sensible thing…

Contents