> For the complete documentation index, see [llms.txt](https://eece.gitbook.io/mist-innovation-club-flutter-course-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eece.gitbook.io/mist-innovation-club-flutter-course-1/dart-fundamentals-1/constructor/default-constructor.md).

# Default Constructor

{% embed url="<https://youtu.be/ulPdujhV_P8>" %}

{% hint style="success" %}
Every class has a default constructor .  The constructor is implicitly called whenever a&#x20;

object is created from that class&#x20;
{% endhint %}

```dart

void main() {
  
  
  var employee1 = Employee();
  
  
}



class Employee{
  
  int id;
 
  String firstname;
  
  String lastname; 
  
  String  position;
  
  int number_of_day_worked;
  
  
  
  
  // Looks like a function , but not a function 
  
  //Default Constructor 
  
  Employee(){
   
    
    print("A Default constructor constructing a object");
    

    
  }  
  
  
}
```

{% hint style="success" %}
If you write  a piece of code inside the default constructor , that piece of code will get executed when you create the object .
{% endhint %}

![](https://1972396024-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCuqiBdVbVkT07RwbQD%2F-MDOP4WIZbE64DzdjRl_%2F-MDORixe8M9KSbpWdqd5%2Fdiagram-20200729.svg?alt=media\&token=3d6953d0-e921-4840-bf3a-5406d9f138d0)

{% tabs %}
{% tab title="Constructor " %}
![Analogy :  Constructor Constructing an object with Class ](https://1972396024-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCuqiBdVbVkT07RwbQD%2F-MDORn-Y0QVYNbCuYm43%2F-MDOSkQflCBZVPmU91st%2Flarge.gif?alt=media\&token=11941221-3167-4d6a-885b-c53b167842c6)
{% endtab %}

{% tab title="Class" %}
![Analogy : Class / template / blueprint ](https://1972396024-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCuqiBdVbVkT07RwbQD%2F-MDORn-Y0QVYNbCuYm43%2F-MDOT-nY2kkvQAyfQmUT%2Flarge.png?alt=media\&token=fca30bf6-ff7b-4b63-9124-47d7f059da92)
{% endtab %}

{% tab title="Constructor Constructing an Object" %}
![](https://1972396024-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCuqiBdVbVkT07RwbQD%2F-MDVeFyxfCbWhqTTiViB%2F-MDVeJeVyhRqBm-xvXGN%2FScreenshot%202020-07-30%20at%2010.57.54%20PM.png?alt=media\&token=64a58a2c-5e8c-44a0-a412-f898ce3bfd15)
{% endtab %}
{% endtabs %}
