1 / 5

Polymorphism

Polymorphism. Page 206-221. Page 206. Objects Every class in Java extends class Object Every class you write extends Obje c t Any class that doesn’t explicitly extend another class, implicitly extends Object Page 208 – ArrayList methods -. Page 209. Class Object – 4 Methods

holmes-hull
Télécharger la présentation

Polymorphism

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Polymorphism Page 206-221

  2. Page 206 • Objects • Every class in Java extends class Object • Every class you write extends Object • Any class that doesn’t explicitly extend another class, implicitly extends Object • Page 208 – ArrayList methods -

  3. Page 209 • Class Object – 4 Methods • Boolean equals () • Tells you if two objects are considered equal • Class getClass() • Gives you back the class an object is instantiated from • InthashCode () • Prints out a hashcode for the object • String toString () • Prints out a string message with name of class & a number

  4. Q & A page 210; Example Page 211 • Read through Q&A – page 210 • Examples of using Polymorphic References of type object – • Good example of Array List Dog Objects v. Any type of objects! • Be Careful!!

  5. Page 212-213

More Related