10-24-2013

posted Oct 24, 2013, 8:45 AM by Samuel Konstantinovich   [ updated Oct 24, 2013, 8:45 AM ]
Goal: More inheritance, superclass constructors

super is a keyword like this.

super refers to the superclass so you can access the methods you have replaced with local copies. e.g. If your subclass has toString(), you can access the toString() in the superclass by saying super.toString()

The subclass inherits all of the methods and instance variables. This includes constructors. Constructors have some special behavior we have to pay attention to.

If you implement any constructors with parameters in a superclass, the subclass must override these constructors.
Comments