Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

@override dart

void main() {
  Point point1 = Point(1, 1);
  Point2 point2 = Point2(10, 10);

  print(point2);
  print("toString has been override");
  print(point1);
}

class Point {
  double x, y;
  Point(this.x, this.y);

  @override
  String toString() {
    return "$x : $y";
  }
}

class Point2 {
  double x, y;
  Point2(this.x, this.y);
}
 
PREVIOUS NEXT
Tagged: #dart
ADD COMMENT
Topic
Name
7+8 =