Object- Oriented Programming Problem

Dear all, 
I have a question about Object-Oriented Programming Problem

Public Class ParentClass
     Protected Function GetData() as DataTable
        doing xxx
      End Function
end Class

Public Class ChildClass Inherits ParentClass
       Public Function GetData() as DataTable
         [I want to call ParentClass GetData() to doing xxx here!!]
          doing yyy
        End Function
end class

above, i want to class the getdata of parent class in childclass, can i do that


Answer this question

Object- Oriented Programming Problem

  • Blaze_wardog

    something like <strong>base.GetData()</strong>
  • The Undead

    Public Class ChildClass Inherits ParentClass 
    Public Function GetData() as DataTable 
    mybase.GetData() 
    End Function 
    end class

  • Waxdoll

    if you stil not got an anser...


    Public Class ParentClass
        Protected Overridable Function GetData() As DataTable
            ' doing(xxx)
        End Function
    End Class

    Public Class ChildClass : Inherits ParentClass
        Protected Overrides Function GetData() As DataTable
           mybase.getdata
           'other stuf
        End Function
    End Class


    or


    Public Class ParentClass
        Protected Function GetData() As DataTable
            ' doing(xxx)
        End Function
    End Class

    Public Class ChildClass : Inherits ParentClass
        Protected Shadows Function GetData() As DataTable
            mybase.getdata
            'do some other stuff
        End Function
    End Class


    I think the 1st one is a bit better

    Remco

  • Object- Oriented Programming Problem