CST338 Module 2
This week's lecture material covered topics such as static vs nonstatic, overrides, equals and hashcode methods, inheritance, and interfaces.
Out of these topics, static values was the one that was the most informative to me. Previously the static modifier mainly meant that I was unable to call a non-static method from a static method and vice versa -- although after the provided explanation the definition is much clearer now.
A static method is a method that belongs to the class rather than an instance of the class while a non-static method belongs to the instance. This means that static items can be updated and called from anywhere just by referencing the class and non-static items must be called in context to an instance of the class.
The projects for this week were the Vacuum Inheritance and the Shelf projects. The Vacuum Inheritance project went over utilizing abstract classes, interfaces, and inheritance. The shelf class handles the individual shelf objects that are in the final Library object.
Comments
Post a Comment