Week 3 CST 338: Inheritance & Arrays

What is the largest multi-dimensional array that you have used? For the scope of my previous classwork, I have only used 2D arrays (matrices).

What is the largest that you think would be unwieldy and why? I would imagine that anything above a 3D array would be hard to conceptualize as we live in a three-dimensional world.  

What does inheritance do for your classes?  Have you used it in the past? How? Inheritance allows us to generalize behaviors (methods) and characteristics (instance variables) from superclasses to subclasses. Overriding methods specified in superclasses allows us to redefine the behavior more specific to a subclass. For instance, you can create a general Bird class with a speak method that returns a String “chirp”. You could extend this Bird class in a subclass called LoudBird that returns the uppercase version of this String (super.talk().toUpper()).

Update your learning journal from what you experienced this week with class. This week was my first experience using an enum. I discovered that comparing two enum types via the class’ equals method really just utilizes the == operator so comparing with the method and comparing with the operator are essentially equivalent.

Leave a Reply

Your email address will not be published. Required fields are marked *