interface - polymorphism in java -
is interfaces in java, kind of polymorphism?
no. interfaces in java construct polymorphism ( subtype polymorphism ) working in java, not "kind" of polymorphism.
in polymorphism happens when 2 objects respond same message ( method call ) in different way ( hence poly -> many, morphism -> way or shape : polymorphism -> many ways). in java able send same message 2 different objects have either inherit same parent, or implement same interface.
Comments
Post a Comment