From charlesreid1

Revision as of 05:32, 1 June 2017 by Admin (talk | contribs) (Created page with ""What is an abstract method?" versus, "Explain what an abstract method is. How it works." If they don't specify, start with one, then the other. Write a short outline of wh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

"What is an abstract method?"

versus,

"Explain what an abstract method is. How it works."

If they don't specify, start with one, then the other. Write a short outline of what you're covering on the board. And have your mental picture in mind.

Give a 2-3 sentence definition, and then elaborate on the whiteboard.

The abstract method is a method definition in a class that is intended to be extended via inheritance, and it imposes restrictions on classes extending this class, to ensure a consistent interface.

This is the idea behind Interfaces: not-quite-classes, classes lite,

Classic example: MakesNoise interface. Babies, and Monster Trucks. Don't want inheritance, you want an interface.

(Side note - Golang only implements "object oriented programming" through interfaces, which are more like functional C structs than Java's everything-is-an-object.)