Created
November 25, 2021 23:55
-
-
Save felipecastrosales/c49cb790e7c5dba7aed35360b7d66d39 to your computer and use it in GitHub Desktop.
Classes Abstratas - POO 1.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
void main(){ | |
// Isso não é mais possível | |
// Animal animal = Animal(); | |
// animal.comunicacao(); | |
Cachorro doge = Cachorro(); | |
doge.comunicacao(); | |
Gato gato = Gato(); | |
gato.comunicacao(); | |
} | |
abstract class Animal { | |
void comunicacao(); | |
} | |
class Cachorro extends Animal { | |
} | |
class Gato extends Animal { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment