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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -