Declaration
To declare a constructor you make a method where you don't write any return type and whose name is the name of the class.
class Muppet {
Muppet() {
}
}
Inside of the constructor's body, you can set the initial values for any fields in the class.
class Muppet {
boolean talented;
Muppet() {
talented = true;
}
}
void main() {
Muppet gonzo = new Muppet();
System.out.println(gonzo.talented);
}