"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
//1.
SuperType sup = new SubType();
SubType sub = (SubType)sup;
//2.
SubType sub = (SubType) new SuperType();
Originally posted by Pawel Nowacki:
...am i right?
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by Luca Fabbri:
In practical terms, what's the best way to deal with turning a sup into a sub? Do I have to clone sup into sub?
Arend van der Kolk wrote:Can someone explain one more time why the compiler only knows the types of the references? And why it does not know the runtime of the Object?
A timing clock, fuse wire, high explosives and a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|