Dart - Class #1
import 'dart:math'; class Point { dynamic x, y; Point([this.x=0, this.y=0]); num distanceTo(Point other) { var dx = x - other.y; var dy = y - other.y; return sqrt(dx * dx + dy * dy); } String get outString => "$x,$y"; void increseX(num value) {x += value;} void increseY(num value) {y += value;} } void main() { var p = Point(3, 4); print("[1] p is (${p.x}, ${p.y})"); print("[2] p's type is {$p.ru..
Dart
2023. 12. 5. 08:28