Created
March 27, 2020 20:18
-
-
Save nunomazer/4575666b7ce682976959023a2bfea3af to your computer and use it in GitHub Desktop.
Exemplo de classe em Dart
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 Pessoa { | |
| // atributos | |
| String nome; | |
| int idade; | |
| // métodos | |
| void cumprimentar(String nome) { | |
| print ("Olá " + nome + " me chamo " + this.nome ); | |
| } | |
| } | |
| void main() { | |
| Pessoa p = new Pessoa(); | |
| p.nome = "Ademir"; | |
| p.idade = 46; | |
| p.cumprimentar("Mario"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment