Dart : Encapsulations

Dart : Encapsulations

·

1 min read

Encapsulations

  • Encapsulation is the principle that limits access to of an object's state and the bundling of methods and operations that do work on a set of data.

  • Encapsulation means hiding data

class Employee {
  String name;
}

void main() {
  var myEmployee = Employee();
  myEmployee.name = "Bobby";
}