' this is okay Sub F1(s as String) Sub F1(n as Integer) ' This is also okay Overloads Sub F2(s as String) Overloads Sub F2(n as Integer) ' Error Overloads Sub F3(s as String) Sub F3(n as Integer)
然而,当您在派生类中重载基类方法时,会变得更加复杂.
如果基类有多个重载方法,并且要在派生类中添加重载方法,则必须使用Overloads关键字标记派生类中的方法,否则基类中的所有重载方法在派生类中都不可用类.
详见MSDN.