# Implicit / Default Getters & Setters

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

{% hint style="success" %}
Getters and setters are special methods that provide read and write access to an object’s properties
{% endhint %}

```dart
void main() {
  
   
  // Default/ Implicit  Getters & Setters 
  
  
  
  var employee1 =   Employee();  // Creating employee1 object   
   
  var  employee2 =  Employee(); // Creating employee2  object 
  
  
  
  
  
  
   // Setting the instance variable of employee1 object 
   
  
  // Implict Setters 
  employee1.id =1;
  employee1.name ="John Doe";
  employee1.position ="CTO";
  
  
  
  employee2.id =2;
  employee2.name ="Jane Doe";
  employee2.position ="CEO";
  
  
  
  // Implicit Getters 
  
  print(employee1.id);
  print(employee1.name);
  print(employee1.position);
 
  
  print(employee2.id);
  print(employee2.name);
  print(employee2.position);
 
  
  
  
  
}

class Employee{
  
  
  int id;
  
  String name;
  
  String position;  

  
  
  
  
}
```

{% tabs %}
{% tab title="Setter" %}
![](/files/-MD_7tRGb7aNm92rr3Yw)
{% endtab %}

{% tab title="Getter" %}
![](/files/-MD_8-X0-5NlrLQsLOWk)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eece.gitbook.io/mist-innovation-club-flutter-course-1/dart-fundamentals-1/untitled/default-getters-and-setters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
