I have started programming in VB just 1 an half months before but for implementing program logic I still have a problem, here I have a class called book shelf and books and classes which is to be a module sub main.
I have a box of execution during debugging which tells me: Object reference not set to an instance of an object.
C code is as follows:
class book
Class shelf:Code:Public Class Book Private _titre As String Public Sub New () End Sub Property title () Get Return _titre End Get Set (ByVal value) _titre = value End Set End Property End Class
How do i test the above program using a module whether this written code is working fine.Code:Public Class stager Private t () As book a table books As Integer Public nb Dim j As Integer 'the number of books in the existing floor Sub New () End Sub Sub New (ByVal nombrlivre As Integer) 'the programmer chooses the number of books that may contain un stage deliver = nb - 1 ReDim t (nb) t (nb) = New Book End Sub Sub ajouter_livre (ByVal title As String) If j <= nb Then we added provided that it not exceed the number of book that can hold the floor T (j). Titr title = 'the program hangs here j = j + 1 Else Console.WriteLine ( "The floor is full") End If End Sub End Class


Reply With Quote

Bookmarks