When you use the
static var
keywords to declare a type property:You cannot override the type property in the subclasses.
You can override the type property in the subclasses.
You can override the type property only in the superclass.
When you use the
class var
keywords to declare a type property:You cannot override the type property in the subclasses.
You can override the type property in the subclasses.
You can override the type property only in the superclass.
When you use the
final
keyword to declare an instance method:You cannot override the instance method in the subclasses.
You can override the instance method in the subclasses.
You can override the instance method only once—that is, in just one subclass.
Polymorphism means:
We can call the same method—that is, the same name and arguments—in instances of classes that aren't included in the same hierarchy tree.
We can use the same method—that is, the same name and arguments—to cause different things to happen according to the...
You're reading from Object???Oriented Programming with Swift 2
The rest of the page is locked
You have been reading a chapter from
Object???Oriented Programming with Swift 2Published in: Jan 2016Publisher: ISBN-13: 9781785885693
© 2016 Packt Publishing Limited All Rights Reserved