Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MyBase vs. MyClass

MyBase vs. MyClass

Scheduled Pinned Locked Moved Visual Basic
visual-studiogame-devquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    afronaut
    wrote on last edited by
    #1

    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";

    L R 3 Replies Last reply
    0
    • A afronaut

      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";

      L Offline
      L Offline
      Lasse
      wrote on last edited by
      #2

      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...

      1 Reply Last reply
      0
      • A afronaut

        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";

        R Offline
        R Offline
        Ravi_Shankar
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • A afronaut

          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";

          R Offline
          R Offline
          Ravi_Shankar
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups