COIS 2240H Lecture 8: WEEK 8 part 2
by Denzel Awuah
DepartmentComputing & Information Systems
Course CodeCOIS 2240H
This preview shows half of the first page. to view the full 2 pages of the document.
WEEK 8 part 2
Monday, February 26, 2018
• So far so good
• We have defined what an interface is
• How we interface
• The last question is why?
Things you can do with interfaces
• Achieve polymorphism
• Interfaces are more flexible because a class may implement many different interfaces
• Interfaces are preferably used when there is no default
Interfaces are not perfect, they have their drawbacks.
*When implementing methods that are from an interface, You always need to override them.
Java Abstract Classes
• Interfaces do not actually contain any method implementations they are simply just templates
• Abstract classes function like a base class for other classes
You're Reading a Preview
Unlock to view full version