If I want to override a method one of class A and in class b then how do you declare?
Answer Posted / Supriya Gupta
To override a method from a base class (Class A) in a derived class (Class B), follow these steps:n1. Derive Class B from Class A using the ':' operator, e.g., 'public class B : A'n2. In Class B, declare the overriding method with the same signature as in Class A, but use the 'override' keyword before the return type.n3. Implement the overridden method.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers