Last active
December 28, 2022 12:11
-
-
Save Sfshaza/f176b4c31b4be8a454107d0946fe2fa3 to your computer and use it in GitHub Desktop.
Java-to-Dart codelab: Basic bicycle example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bicycle { | |
int cadence; | |
int speed; | |
int gear; | |
Bicycle(this.cadence, this.speed, this.gear); | |
@override | |
String toString() => 'Bicycle: $speed mph'; | |
} | |
void main() { | |
var bike = new Bicycle(2, 0, 1); | |
print(bike); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment