December 2001
Beginner
976 pages
22h 4m
English
A class is a user-defined data type. Its declaration is similar to the declaration of structures. You can declare it as part of a module; however, due to the fact that classes tend to be much larger (have more lines of code) than structures, they are usually declared in separate files (using the same .vb extension).
Create a new console project and give it the suggestive name ClassExample1. From the Project menu select Add Class and change the filename from Class1.vb to Horse.vb. Enter the lines of code shown in bold in the following example:
Public Class Horse Public m_name As String Public m_color As String Public m_height As Single End Class
This is a class definition. Apparently there are no major differences ...
Read now
Unlock full access