A good answer might be:
Where in the above code is a constructor being used?
|
Constructor Definition SyntaxThe class needs a constructor. Constructor definitions look like this:
No return type is listed in front of className.
There is no TypeName1 parameterName1, TypeName2 parameterName2, ... as many as you need It is OK to have an empty parameter list. A class often has several constructors with different parameters defined for it. Each one builds the same class of object, but will initialize it differently. A constructor returns a reference to the object it constructs. You do not use a return statement for this to happen. Usually the reference is saved in a variable. However, sometimes objects are constructed for temporary use and their reference is not saved. (They are used just once and then become garbage). |
QUESTION 17:
Say that there is a class named Click Here after you have answered the questionDogHouse( String dogName ) int DogHouse( String dogName ) void DogHouse( String dogName ) DogHouse( dogName ) DogHouse( String dogName ); DogHouse() |