Link to home
Create AccountLog in
Avatar of sherbug1015
sherbug1015Flag for United States of America

asked on

Using a non abstract function

I have an abstract class that has 2 abstract methods and 1 non abstract method.  I have created a derived class and I need to call the non abstract method and i don't seem to be able to access it.

How do I call a non abstract method in an abstract class from the derived class.

Thanks for your help.
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi  sherbug1015;

Make sure that the accessor is not private for the method so that it is available to sub-classes.
Avatar of sherbug1015

ASKER

Here is an example of what I have:

Public MustInherit Class AbstractClass
    Public Function AddTwoNumbers(Num1 As Integer, Num2 As Integer) As Integer
        Return Num1 + Num2
    End Function
    Public MustOverride Function MultiplyTwoNumbers(Num1 As Integer, Num2 As Integer) As Integer

End Class

This is the Derived Class

Public Class DerivedClass2
    Inherits AbstractClass


    Public Overrides Function MultiplyTwoNumbers(Num1 As Integer, Num2 As Integer) As Integer

    End Function



End Class

How do I call the AddToNumbers Function from the derived class.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer