What is MyBase keyword?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is MyBase keyword?

Rating:

The MyBase keyword is used to refer to the immediate base class of the current instance of a class. For example, if Class2 inherits from Class1, Class1 is called the base class of Class2, and Class2 is the derived class of Class1. Class1 can be referenced in the code of Class2 by using the MyBase keyword. The MyBase keyword is used to access those members of the base class, which are overridden or shadowed in the derived class. Following are some restrictions imposed on the usage of the MyBase keyword:

  • It cannot be used to access the Private members of the base class.
  • It cannot be used to call MustOverride base methods.
  • It cannot be assigned to a variable.
  • It cannot be passed to procedures.
  • It cannot be used in modules.
  • If the derived class is defined in an assembly different from that of the base class, the MyBase keyword cannot be used to access the base class members that are marked as Friend.
  • It cannot be used with the Is operator for logical comparison.
  • It cannot be used to qualify itself. For example, using the MyBase.MyBase.Button1_Click() statement is invalid.


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.