MyBase vs. MyClass
-
What, precisely, is the difference between the two? Both are meant to call the parent classes implementation of a member from a derived class, no? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
You can use the MyBase keyword to call methods in a base class when overriding methods in a derived class. The MyClass keyword allows you to call an Overridable method implemented in your class and make sure that implementation of the method in this class is called rather than an overridden method in a derived class. Hmm...
-
What, precisely, is the difference between the two? Both are meant to call the parent classes implementation of a member from a derived class, no? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
Hi MyBase's explanation goes like this: The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class. MyBase is commonly used to access base class members that are overridden or shadowed in a derived class. In particular, MyBase.New is used to explicitly call a base class constructor from a derived class constructor. MyClass's explanation goes like this: MyClass behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. Therefore, the method being called is not affected by overriding in a derived class. For difference between MyClass and Me refer ms-help://MS.NETFrameworkSDK/vblr7net/html/vakeyMyClass.htm[^] from the .NET Framework SDK Documentation Ravi Shankar S Product Designer iSOFT R&D Pvt Ltd Chennai, INDIA Ph: 91-44-4414980 Extn 1103
-
What, precisely, is the difference between the two? Both are meant to call the parent classes implementation of a member from a derived class, no? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
Hi Refer http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vaconInheritanceBasics.asp[^] for more details on the difference Ravi Shankar S Product Designer iSOFT R&D Pvt Ltd Chennai, INDIA Ph: 91-44-4414980 Extn 1103