Is coercion different from "coercion polymorphism"?

125 views Asked by At
  1. If just coercion is a kind of polymorphism, then coercion happens even in non-oops languages. So, i want to know whether the term "coercion" is different from "coercion polymorphism"?

  2. If coercion happens at the time of function call where the type of the argument passed in a function call coerces to the type of the parameter in the function definition and if the same happens with an operator, then we call it "coercion polymorphism". Is this statement, correct? If so, whether such a thing happens in language C(non-oops language)?

  3. In Java, BOXING concept is an example of coercion. Can that be considered as "coercion polymorphism" too?

  4. Passing a subclass object reference to a superclass object reference during a method call can also be considered as "coercion polymorphism"?(I read somewhere). In that case upcasting and coercing polymorphism means the same in a sense. So, is that correct?

0

There are 0 answers