 Let's take a look at these three classes. The item class describes an item for sale. An item has a name, an SKU, sort of like an ID number, and a price. A sale item extends item, and it adds a discount field. The custom item class extends item as well, and it adds a surcharge field because custom items need to be custom-made. All three of these classes have a calc order method that takes a quantity and returns a total price for the order. Here it is an item, and in sale item, and in custom item. How is this possible? How can we have multiple methods with the same signature, the name, number of parameters, and parameter type? It's possible because they're in different classes. The method in the subclass overrides the method in the parent class. Let's look at the code for calc order in all three classes. For a regular item, it's a straight multiplication of quantity times price. For a sale item, we multiply the quantity times price, and then subtract the discount factor. And for a custom item, we multiply the quantity times price, and add the surcharge. Here's a test program that creates one of each type. It creates a regular item, pencils, a sale item, and a luxury item. It then calculates the price for an order of each type of item, and prints the results. When we call the calc order method for the regular item, the method in item is called because regular is an instance of item. When we call cheap.calc order, the method in sale item is called because cheap is an instance of sale item. And when we call the calc order method for the luxury item, the method in custom item is called because luxury is an instance of custom item. I've put an at sign override annotation in the code to let Java know that this method is overridden in sale item and in custom item. This will tell Java to check that there really is a method with the same signature in a superclass. This helps avoid errors. By the way, we can do a quick improvement. Here in sale item, instead of repeating the multiplication, we can call super.calc order with the quantity. And we can do the same here in custom item. What's the difference between overriding and overloading? Let's add another method to sale item.java. It's going to be public double calc order. We'll have a quantity and we will also add a double called secret discount for our best customers. And that will return super.calc order of quantity times 1.0 minus our discount plus the additional secret discount. This is an overloaded method. It has the same name as another method, but it has a different signature. It has a different number of arguments than the other method with the same name. And that's the difference between them. When you override a method, it has the same name and the same arguments as a method in a superclass. An overloaded method has the same name, but a different number or type of arguments than a method in the same class or a superclass.