Dart: Object Cheat Sheet

StateDescribes the object. The fields of a class represent the object’s state.
BehaviorDescribes what an object can do.
IdentityA unique value that distinguishes an object from a set of similar other objects. Two or more objects can share the state and behavior but not the identity.

The Cascade operator


class Student { 
   void test_method() { 
      print("This is a  test method"); 
   void test_method1() { 
      print("This is a  test method1"); 
void main() { 
   new Student() 

=> output

This is a test method 
This is a test method1

The toString() method

void main() { 
   int n = 12; 

=> output


Leave a Reply

Your email address will not be published. Required fields are marked *