import std.stdio; import std.string; abstract class Pessoa { string nome; string getNome() { return nome; } abstract void print(); } class Empregado : Pessoa { int empID; override void print() { writeln("Detalhes do empregado:"); writeln("ID: ", this.empID); writeln("Nome: ", this.nome); } } void main() { Empregado emp = new Empregado(); emp.empID = 101; emp.nome = "Empregado101"; emp.print(); }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more