There's something I want to customize in the System.Web.Script.Services.ScriptHandlerFactory and other .NET stuff inside an internal class. Unfortunately, it's an internal class. What options do I have when trying to customize a method in this class?
In C#, a method in a derived class can have the same name as a method in the base class. You can specify how the methods interact by using the new and override keywords. The override modifier extends the base class virtual method, and the new modifier hides an accessible base class method.
private methods of a class are not visible in its child class so they won't get inherited. Save this answer. Show activity on this post. No, you can't override private elements, they're effectively final (because they're never visible from a subclass to be overriden.)
The short answer is that it doesn't matter. Public methods of an internal class are internal. To the compiler, the internal/public method distinction only matters for public classes.
You might find this recent article enlightening. Basically, it says that you can't override anything marked internal
, and the source is about as authoritative as it gets. Best you can hope for is an extension method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With