Assuming I have an instance of an object that I know belongs to a subclass of a certain subtype passed to me through a reference of a supertype in C#, I'm used to seeing typecasting done this Java-like way (Assuming "reference" is of the supertype):
if (reference is subtype){
subtype t = (subtype)reference;
}
But recently I've come across examples of what appears to be the same thing done this way:
if (reference is subtype){
subtype t = reference as subtype;
}
Are those two completely equivalent? Is there any difference?