Prashant More

Prashant More

  • NA
  • 87
  • 165.7k

A new problem

Oct 23 2008 12:53 PM

Hello All,

I am back with a new problem.This time i am doing a console application in vb.net as follows

Class Pub
    Public price As Single
    Public title As String
    Public Sub New(ByVal p As Single, ByVal t As String)
        price = p
        title = t
    End Sub
    Public Sub display()
        Console.WriteLine(price + " " + title)
    End Sub
   
End Class
Class Book Inherits Pub
    Public page As Integer
    Public Sub New(ByVal p As Single, ByVal t As String, ByVal p1 As Integer)
        MyBase.New(p, t)
        page = p1
    End Sub
    Public Sub Show()
        MyBase.
        Console.WriteLine(page)

    End Sub
    Sub Main()
        Dim b1 As Book = New Book(25.7, "Radheya", 51)
        b1.Show()

 


    End Sub
End Class

The problem arrives to this part

 Public Sub Show()
        MyBase.
        Console.WriteLine(page)

    End Sub

Please anyone tell me how can we call the base class member function into the derived class member function.

Thanks & Regards

Prashant S. More


Answers (2)