View Single Post
Old Feb 19th, 2007, 6:10 AM   #1
melwinator20
Newbie
 
Join Date: Feb 2007
Posts: 1
Rep Power: 0 melwinator20 is on a distinguished road
Question Inheritance Blues

I have a problem for which I dont seem to be getting a solution.

I have 3 projects namely Project A,B and C.

In projectA, I have defined a public class ClassA

Public Class ClassA
    Public Shared Function ClassAFunction() As String

        Return "Class A"

    End Function


End Class

In ProjectB, I have inherited from the ClassA in ProjectA.

Imports ProjectA
Public Class ClassB
    Inherits ProjectA.ClassA

    Public Shared Function ClassBFunction() As String
        Return "Class B"
    End Function


End Class

In ProjectC, I have given a reference to ProjectB.

I am able to access the function present in ClassB but not the functions inherited from ClassA.

eg: ClassB.ClassBFunction() ----- allowed
ClassB.ClassAFunction() ----- not allowed.

But if I overload the ClassAFunction within ClassA, then it is accessible.
eg: ClassB.ClassAFunction() ---- allowed

Could anyone tell me the reason
melwinator20 is offline   Reply With Quote