Composition Polymorphism Encapsulation

Ok so after working a bit more, composition is still a bit confusing with trying to access methods in different classes, but overall it makes sense, implementing it is a bit harder. Encapsulation is allowing a user access only what needs to be accessed, and polymorphism generally seems to be creating a superclass and then utilizing a subclass/its methods as needed. (E.g. having a Car class with a drive method, and then having a HondaCivic class with a drive method that overrides the Car class). From what I understand with polymorphism, Java will create the correct class/object and utilize the correct method associated with the created object.

Written on June 25, 2017