课程: Learning Java Collections

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Challenge: Advanced collection problems

Challenge: Advanced collection problems - Java教程

课程: Learning Java Collections

Challenge: Advanced collection problems

(upbeat music) - [Instructor] We're going to do a back-to-back challenge, so you get more experience working with collections. In this challenge, the Landen Hotel has provided three additional methods on the room service class for you to implement. Like last time, they've provided a unit test for you to check your work. And within the body of each method, they've included the instructions for exactly what the method needs to do. The first method, hasRoom, will check if the room provided to this method as an argument, is found within our collection inventory. If it is, it'll return the boolean true. If it's not, it will return the boolean false. The next method, asArray, is going to return an array that contains all of the rooms found in our inventory collection in the order they were added. That last part about order is really important, and you'll want to keep that in mind while you're working on your solution.…

内容