not exactly...constructors run code only once...so if you instantiate (create) an object from a class it will run the code in the constructor...parameters in the constructor label an objects predefined value...
so if you have an object called dog
you can use parameters to make the dogs
weight
breed
height
etc...
remember constructors are named after the class...and never return a value
Comments
not exactly...constructors run code only once...so if you instantiate (create) an object from a class it will run the code in the constructor...parameters in the constructor label an objects predefined value...
so if you have an object called dog
you can use parameters to make the dogs
weight
breed
height
etc...
remember constructors are named after the class...and never return a value