I understand that you can override a method (marked as Virtual) in a base class from a derived class using keywords override.
But what about overriding a method in one class?
In my specific case, I have a class xwith two methods. The method ahas some common behavior with b, but badds functions to the method a.
In the past, I duplicated code ain band added new functionality to b.
I would like to know if there is a better approach, so I can centralize the behavior of the method a.
public class x
{
public static void a() {}
public static void b() {}
}
Thank you for your time: -)!