Homework 01 § See description on Canvas. It is all about inheritance, abstract (class and method), and polymorphism. § Due date: Sep 21 at 1:29 PM You have a week to accommodate to your needs, but you do not need a full week to complete it. No extensions
Interfaces § Interfaces contains behaviors that a class implements. § An interface cannot be instantiated § An interface does not contain any constructors. § In an interface, all methods are abstract. § An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final. § An interface is not extended by a class; it is implemented by a class. § An interface can extend multiple interfaces.
The toString Method § The toString method is a method that takes no parameter and returns a string § A returned string usually contains information on instance variables of its class. § Each class has a default toString method that contains its class object name and hash number. § When an object is used with System.out.println method, its toString method will be called.
Polymorphism § A polymorphic reference is a reference variable that can refer to different types of objects at different points in time. § Polymorphic references are resolved at run-time, not during compilation.