Inheritance and dynamic variable creating questions

Hi!

Suppose there is a class ClassC and class ClassA and ClassB are inherited from class ClassC. I was wondering what these lines will actually do if valid.

1
2
ClassB b1 = new ClassA();
ClassB b2 = new ClassC();
Last edited on
Have you actually tried it?
Topic archived. No new replies allowed.