class A { int x; } class B : A { int y; }
Object a = new A(); Object b = (B)a;
Login in to like
Login in to comment
@ip41m0334 true! thanks
2017 Dec 6, 11:40:45 AM
Object a = new A(); Object b = (B)a; will compile succesfully, but throw an exception at runtime
2017 Sep 29, 9:34:11 PM
or Read more about C# Quizzes
Login in to like
Login in to comment