Advertisement
tutorfree

Exercicio_Polimorfismo03_-_PacotePrincipal_-_FuncaoPrincipal

Sep 3rd, 2015
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.70 KB | None | 0 0
  1. package Polimorfismo2;
  2.  
  3. import Entidade.Funcionario;
  4. import Entidade.Gerente;
  5.  
  6. public class Principal
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Funcionario f = new Funcionario(1500);
  11.         Gerente g = new Gerente(3600);
  12.         Funcionario s = new Funcionario(2300);
  13.        
  14.         f.setNome("Ernesto Souza");
  15.         f.setIdade((short)45);
  16.        
  17.         g.setNome("Astolfo Bastos");
  18.         g.setIdade((short)56);
  19.         g.setBonus(790);
  20.        
  21.         s.setNome("Carolina");
  22.         s.setIdade((short)22);
  23.         g.setSecretaria(s);
  24.        
  25.         f.aumentoSalario();
  26.         g.aumentoSalario();
  27.        
  28.         f.exibeDados();
  29.         g.exibeDados();
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement