You can cast a sub class to its super class, not the opposite

Maurice

-----Message d'origine-----
De : Seema Makkar [mailto:seema.mak...@aricent.com] 
Envoyé : mercredi 30 octobre 2013 10:50
À : dev@flex.apache.org
Objet : Issues in Type casting

Hello all ,

I have created customize class that extends Arraycollection For eg

Public class PagingArrayCollection extends Arraycollection

Now I have to cast ArrayCollection to PagingArrayCollection.
Suppose
Var arr: ArrayCollection = new ArrayCollection(); Var lst: 
PagingArrayCollection= new PagingArrayCollection();

Lst= arr;


But it is giving Implict coercion

If I will typecast
Lst= arr as PagingArrayCollection;

Then it is returning null values.

How can we type cast?
Please suggest.


Thanks,
Seema








===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================

Reply via email to