I have the following class:
Public Class Book
Public isbn as Integer
Sub New(isbn as Integer)
Me.isbn = isbn
End Sub
End Class
All right, if I want to create an instance variable I have to pass parameters to the constructor and everything normal, but what is the difference between an instance variable:
Public NuevoLibro as New Book(isbn)
And have a variable of type class inside the class (in this case I have created a variable called book):
Public Class Book
Public isbn as Integer
Public libro as Book
Sub New(isbn as Integer)
Me.isbn = isbn
End Sub
End Class
This example is in visual basic, but in java it can also be done, so I guess this even has a name.