c# - Does the New keyword call an inherited object's function? -


in c#, if have object inherits object, , inherited object has function same name base object, if want call base object's function when inherited object's function called, should use new keyword? if not, how best way call both functions?

here example:

public partial class formtest : form {     public new void refresh()     {         testfunction();     } } 

basically, asking if refresh function of form object called when refresh function of formtest object called. also, refresh function of form object called first, or called after refresh function of formtest object.

using new keyword indicate explicit base class method refresh should hidden. refresh method of base class not called in case. in order call base class method use base.refresh() in refresh method of formtest class.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -