What they do
Make it simpler for initialising a lot of objects
Special method to initialise class variables
Constructor set up
Have capitol of method and don’t have a return type
(){
Body
}
Parameterless constructor
Constructor with no arguments. Java creates parameterless constructor (no arguments)
I.e class Customer {
}
Note: Java sets initial default values to null or 0
Parameterised constructor
Accepted parameters which are assigned to instance variables of the class for that object
Class Customer {
Instant variables
Customer(dat type variables) {
Assign parameters to instant variable
} }Multiple constructors
Used to initialise different members.
Class can have multiple constructors
Parameters of a constructor are?
LOCAL PARAMETERS