From charlesreid1

No edit summary
No edit summary
Line 20: Line 20:




[[Category:Object Oriented Programming]]
[[Category:OOP]]
[[Category:Java]]
[[Category:Java]]
[[Category:CS]]
[[Category:CS]]
[[Category:Inheritance]]
[[Category:Inheritance]]
[[Category:Interfaces]]
[[Category:Interfaces]]

Revision as of 05:33, 1 June 2017

"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.)