Rent – Cheaper alternatives:
Check Your Library:
Older Edition (10th or 9th):
A versão Kindle do livro está disponível na Amazon. Você pode ler no PC, tablet ou celular. Frequentemente, a Amazon oferece um período de amostra grátis (primeiros capítulos). Use a busca por: Java Como Programar Deitel 11ª Edição Kindle.
In Chapter 8 (Classes and Objects) and Chapter 9 (Object-Oriented Programming) , Deitel emphasizes cohesion – each class should represent a single, well-defined entity.
class Bird public void fly() /* fly logic */
class Penguin extends Bird @Override public void fly() throw new UnsupportedOperationException("Penguins can't fly!"); // This breaks LSP – you can't safely substitute Penguin for Bird
Chapter 10 introduces interfaces. Deitel’s examples (like Payable) are naturally narrow. ISP says: split large interfaces into smaller, role-specific ones.
// Violation: One class handles both employee data AND payroll calculation class Employee private String name; private double salary;public void saveToDatabase() /* ... */ public double calculateBonus() /* ... */// Compliance: Separate responsibilities class Employee private String name; private double salary; // getters/setters only
class PayrollCalculator public double calculateBonus(Employee emp) /* ... */
class EmployeeRepository public void save(Employee emp) /* ... */