In this case the null value should be returned when looking


Implement the find Product method. This should look through the collection for a product whose id field matches the ID argument of this method. If a matching product is found, it should be returned as the method's result. If no matching product is found, return null. This differs from the print Product Details method in that it will not necessarily have to examine every product in the collection before a match is found. For instance, if the first product in the collection matches the product ID, iteration can finish and that first Product object can be returned. On the other hand, it is possible that there might be no match in the collection. In that case, the whole collection will be examined without finding a product to return. In this case, the null value should be returned. When looking for a match, you will need to call the get ID method on a Product.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: In this case the null value should be returned when looking
Reference No:- TGS02169628

Expected delivery within 24 Hours