Last active
April 7, 2022 05:39
-
-
Save freedive-cebu30/8413fa4afef741e62a8660e1016ef499 to your computer and use it in GitHub Desktop.
This file contains 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 Person { | |
String name; | |
int age; | |
// {}をつけている | |
Person({required this.name, required this.age}); | |
} | |
void main(){ | |
// インスタンス化する時に、nameとageを指定している | |
Person jojo = Person(name: 'jojo', age: 30); | |
print(jojo); // Instance of 'Person' | |
print(jojo.name); // jojo | |
print(jojo.age); // 30 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment