Hello, This is my first post on this website so I'm not sure if it's good practice for me to upload as large a post as I have done. Currently I am following along with an online course to learn programming for Java 17. At the end of each section there are challenges to practice our understanding of the topics covered, the one I have just finished was about Java Collections. What I am finding hard with it is to get feedback on the code that I have wrote.
This challenge was the first where there wasn't as much hand holding and the only thing that was given were the class requirements and their methods and fields to create an Inventory System, and it was up to us to figure out what type of collection to implement and how each method would function.
I was hoping to get some feedback on best practices, I'm not imagining anyone to go through everything line by line but if someone could maybe have a look at the odd bit and point out how they would have done things differently? One of the things I was most interested in was that I made the Cart class an inner class of the Store class and I'm not sure if this is good practice or not as I am struggling to understand the benefits of inner classes and not sure if they are used much so wanted to experiment to find a use for them and this made sense as the when the cart is instantiated it automatically adds itself to the list of Carts belonging to the Store.