Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
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
Old Feb 19th, 2007, 8:59 AM   #2
dr.p
Programmer
 
dr.p's Avatar
 
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3 dr.p is on a distinguished road
VB Docs read thusly:
Friend Class BaseClass
    Public Sub BaseMethod()
        ' Add code here to define BaseMethod.
    End Sub
End Class

Friend Class DerivedClass
    Inherits BaseClass
        ' Gets BaseMethod from friendly parent
End Class
__________________
Neeley.org
dr.p is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not class inheritance Writlaus C++ 3 Sep 2nd, 2006 7:44 PM
Inheritance and polymorphism exercise problems, plus other questions codylee270 C++ 1 Apr 19th, 2006 10:29 PM
Reverse Inheritance Darkhack C# 3 Jan 16th, 2006 5:05 PM
Multiple inheritance Shatai C++ 5 Apr 30th, 2005 7:16 PM
Inheritance PurpleMonkeyDW Java 1 Jan 17th, 2005 5:38 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC