Constructor

Constructor




 A constructor is a method, but this is a big method, this method is created with the name of the related class, it does not have a return type. The constructor is not executed all the time, the constructor can be executed only when an object is created.

It may contain instructions to run a program first. Although the constructor does not have a return type, arguments can be used to pass values.



No comments:

Post a Comment

Pages