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.

iiiSUMÁRIO6.4 Exercícios Complementares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 Encapsulamento 737.1 Atributos Privados . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.2 Métodos Privados . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.3 Métodos Públicos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747.4 Implementação e Interface <strong>de</strong> Uso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757.5 Por quê encapsular? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757.6 Celular - Escon<strong>de</strong>ndo a complexida<strong>de</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757.7 Carro - Evitando efeitos colateiras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767.8 Máquinas <strong>de</strong> Porcarias - Aumentando o controle . . . . . . . . . . . . . . . . . . . . . . . 777.9 Acessando ou modificando atributos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787.10 Getters e Setters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787.11 Exercícios <strong>de</strong> Fixação . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797.12 Exercícios Complementares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818 Herança 838.1 Reutilização <strong>de</strong> Código . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.2 Uma classe para todos os serviços . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.3 Uma classe para cada serviço . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.4 Uma classe genérica e várias específicas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858.5 Preço Fixo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878.6 Reescrita <strong>de</strong> Método . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878.7 Fixo + Específico . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888.8 Construtores e Herança . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898.9 Exercícios <strong>de</strong> Fixação . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908.10 Exercícios Complementares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929 Polimorfismo 939.1 Controle <strong>de</strong> Ponto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939.2 Mo<strong>de</strong>lagem dos funcionários . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949.3 É UM (extends) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959.4 Melhorando o controle <strong>de</strong> ponto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959.5 Exercícios <strong>de</strong> Fixação . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969.6 Exercícios Complementares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9710 Classes Abstratas 9910.1 Classes Abstratas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9910.2 Métodos Abstratos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10010.3 Exercícios <strong>de</strong> Fixação . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10110.4 Exercícios Complementares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10311 Interfaces 10511.1 Padronização . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10511.2 Contratos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10511.3 Exemplo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10611.4 Polimorfismo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10711.5 Interface e Herança . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10711.6 Exercícios <strong>de</strong> Fixação . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109www.<strong>k19</strong>.com.briii

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

Saved successfully!

Ooh no, something went wrong!