My question is regarding Inheritance and Polymorphism.
I have a class A which is the super class. Classes B and C extends A and are subclasses.
Now i have a function in other class(not A or B or C) that takes argument of type A. So polymorphism allows us to pass the argument as A , B or C to that function. Now in that function, inorder to access B s properties, i have to typecast the received argument to B.
是否打造了良好的方案拟订技术? 难道这里使用多吗?
Thanks.