If you observe the above result, our constructor method has called automatically and initialized the parameter values after creating an instance of our class. ![]() When we execute the above visual basic program, we will get the result as shown below. When we create an instance of our class ( User), then automatically our constructor method will be called. If you observe the above example, we created a class called “ User” and the constructor method “ New()” without having any parameters. ![]() ![]() ' The constructor will be called automatically once the instance of the class createdĬonsole.
0 Comments
Leave a Reply. |