# Access Modifiers and \_ symbol

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

{% hint style="success" %}

* [x] There are no access modifier keyword in dart
* [x] public , private , protected keyword don't exist in dart.
* [x] You can prepend something with \_ to make it private in library level
  {% endhint %}

{% tabs %}
{% tab title="a.dart" %}

```dart
class Employee {
  String name;
  String _position;
}

void main() {
  var employee1 = Employee();
  employee1.name = "John Doe";
  employee1._position = 'CTO';
  print('${employee1.name}: ${employee1._position}');
}

```

{% endtab %}

{% tab title="b.dart" %}

```dart
import 'a.dart';

void main() {
  var employee2 = Employee();
  employee2.name = "Jane Doe";
  employee2._position = "CEO"; // Will Show error 

  // employee1._position = 'CEO';
  print('${employee2.name}');
}
```

{% endtab %}
{% endtabs %}

![](/files/-MDXb0Oki1hne0QIp-zD)


---

# 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/access-modifiers-and-_-symbol.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.
