Object/Instance

Object/Instance is created from a Class which you can think as a blueprint or template for creating that object/instance.

Creating an object/instance in dart

void main() {
  
  // Object or Instance 
  
  var employee1 = new Employee();
  
    print(employee1);

}



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


Creating an object is sometimes called "instantiation"

The "new" keyword is optional

Last updated