12.07.2015 Views

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

201 RESPOSTAS12 System . out . println (" Senha : " + this . senha );13 }1415 // GETTERS AND SETTERS16 }Código Java 8.29: Gerente.java1 class Telefonista extends Funcionario {2 private int estacaoDeTrabalho ;34 public void mostraDados () {5 super . mostraDados ();6 System . out . println (" Estação <strong>de</strong> Trabalho " + this . estacaoDeTrabalho );7 }89 // GETTERS AND SETTERS10 }Código Java 8.30: Telefonista1 class Secretaria extends Funcionario {2 private int ramal ;34 public void mostraDados () {5 super . mostraDados ();6 System . out . println (" Ramal " + this . ramal );7 }89 // GETTERS AND SETTERS10 }Código Java 8.31: Secretaria.javaResposta do Complementar 8.31 class TestaFuncionarios {2 public static void main ( String [] args ) {3 Gerente g = new Gerente ();4 g. setNome (" Rafael Cosentino ");5 g. setSalario (2000) ;6 g. setUsuario (" rafael . cosentino ");7 g. setSenha (" 12345 ");89 Telefonista t = new Telefonista ();10 t. setNome (" Carolina Mello ");11 t. setSalario (1000) ;12 t. setEstacaoDeTrabalho (13) ;1314 Secretaria s = new Secretaria ();15 s. setNome (" Tatiane Andra<strong>de</strong> ");16 s. setSalario (1500) ;17 s. setRamal (198) ;1819 System . out . println (" GERENTE ");20 g. mostraDados ();2122 System . out . println (" TELEFONISTA ");23 t. mostraDados ();2425 System . out . println (" SECRETARIA ");26 s. mostraDados ();www.<strong>k19</strong>.com.br 201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!