Created
March 24, 2020 01:44
-
-
Save Wigny/c036c6cb935b1db7a5a42906a09aa563 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 Aluno { | |
String nome; | |
int idade; | |
Aluno(String nome, int idade) { | |
this.nome = nome; | |
this.idade = idade; | |
} | |
} | |
class Aula { | |
Aluno aluno; | |
String materia; | |
Aula(Aluno aluno, String materia){ | |
this.aluno = aluno; | |
this.materia = materia; | |
} | |
} | |
void main() { | |
Aluno ivan = new Aluno('Ivan', 25); | |
Aula aula = new Aula(ivan, 'Testes'); | |
print(aula.aluno.nome + ' tem aula de ' + aula.materia); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment