Dev study and notes

[dart] #20 #4.0 Your First Dart Class (04:42) 본문

studyLog

[dart] #20 #4.0 Your First Dart Class (04:42)

devlunch4 2023. 5. 3. 06:01
반응형
class Player {
    final String name = 'lunch';
    int xp = 9999;

    void sayHello() {
        print("Hi my name is $name");
  }
}

void main() {
    var player = Player();
    print(player.name);
    player.sayHello();
}

// PRINT
// >>>
// lunch
// Hi my name is lunch
반응형
Comments