The second is that because the compiler is responsible for calling the constructor, it must always know which method to call. It makes sense that such a method will be called automatically on initialization. It is guaranteed that the object will be properly initialized before you can get your hands on it. Note that the coding style of making the first letter of all methods lower case does not apply to constructors, since the name of the constructor must match the name of the class exactly . Like any method, the constructor can have arguments to allow you to specify how an object is created.
Constructors eliminate a large class of problems and make the code easier to read.
The constructor is an unusual type of method because it has no return value . Constructors return nothing and you don't have an option. If there were a return value, and if you could select your own, the compiler would somehow need to know what to do with that return value. Knowledge Market . For tons of Windows technology resources, check out the Windows Programming directory .