Introduction to Objects An object is a representation of an person, place or thing. Think of it as a noun. An object has attributes (properties) that describe it. Think of these as adjectives. An object has methods, things you can do with it. Think of these as verbs. A class is the code file created to represent the object, including its attributes and methods. OOP Fundamentals Abstraction Extracting the essence of what an object is and does Encapsulation Hiding the process of how an object does its work. It's only necessary to know that it can do it. Inheritance As when a child is born with the characteristics of his/her parent. Polymorphism Having the same method, but carrying it out differently. You would calculate the pay for an hourly employee differently than that of a salaried employee, but you still have to calculate the pay. Is A A passenger car, truck, or bus are all specialized versions of a motor vehicle. Has A A passenger car has an engine. The engine is a class of its own that can be removed and replace. Uses A person uses an automobile. public class Employee { private String name = ""; private long idNbr = 0; public double calculatePay() {} public setName(String newName) { name = newName; } public getName() { return name; } public setIdNbr(long newIDNbr) { idNbr = newIdNbr; } public getIdNbr() { return idNbr; } } public SalariedEmployee extends Employee { double annualSalary = 0; String name = ""; public double calculatePay() { this.name; super.name; return annualSalary / nbrOfPayPeriods; } } public HourlyEmployee extends Employee { double hourlyRate = 0; double hoursWorked = 0; public double calculatePay() { return hourlyRate * hoursWorked; } } SalariedEmployee ed = new SalariedEmployee(); ed.calculatePay(); ed.setName("Joe");